Skip to content

[llvmgcc] Variable length array indexing miscompiled #670

Closed
@lattner

Description

@lattner
Bugzilla Link 298
Resolution FIXED
Resolved on Feb 22, 2010 12:45
Version 1.0
OS All

Extended Description

It looks like we are miscompiling indexes through C99 VLA's in some cases. File
this into the "wow, I didn't know you could do that" catagory. :)

Testcase:


int foo(int len, char arr[][len], int X) {
return arr[X][0];
}

The correct addressing arithmetic to generate is "arr + X*len", which we don't
do in this case.

-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