Skip to content

VLAs are compiled incorrectly in both setup and teardown #28

Closed
@mateoconlechuga

Description

@mateoconlechuga

Minimal reproducible examples:

int main(void)
{
    int x = 0;
    for (int i = 0; i < 10; ++i) {
        int args[i];
        args[i-1] = i;
        x += args[0];
        args[0] = 0;
    }

    return x;
}

int main(void)
{
    unsigned long x = 0;
    for (unsigned long i = 0; i < 10; ++i) {
        unsigned long args[i];
        for (unsigned long j = 0; j < i; ++j) {
            args[j] = i;
        }
        x += args[0];
        args[0] = 0;
    }

    return x;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions