Skip to content

Clang initialization code generation can be improved #651

Closed
@lattner

Description

@lattner
Bugzilla Link 279
Resolution FIXED
Resolved on Dec 02, 2010 01:07
Version unspecified
OS All
CC @lattner

Extended Description

Though we are generating better code for GCC CONSTRUCTOR nodes (See Bug 275), we
still aren't doing as well as we should do. In particular, we handle cases like
this poorly:

int foo(int X) {
int Arr[100] = { X }; // Should use memset
int Arr[10000] = { 1 }; // Should use memset

// Should memcpy the whole thing
struct { int A, B } Pairs[10] = { {1, 2 }, { 0, 0 } };
}

... While the first ones could be addressed right now, the last one requires a
rewrite of how we handle constructors, which is needed to fix several code
correctness bugs anyway. This bug is just a tracker for when this happens.

-Chris

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions