LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 8567 - Incorrect code for VLA pointers
Summary: Incorrect code for VLA pointers
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: -New Bugs (show other bugs)
Version: trunk
Hardware: PC Linux
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-08 12:35 PST by Jed Brown
Modified: 2010-11-08 19:32 PST (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments
Test case (311 bytes, text/x-csrc)
2010-11-08 12:42 PST, Jed Brown
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jed Brown 2010-11-08 12:35:32 PST
Problem is for pointer of form

double (*p)[n][5];

where n is a runtime parameter.  Test case attached.

$ gcc -Wall -std=c99 vla-bug.c && ./a.out
 test_static: size 15  diff 15
    test_var: size 15  diff 15
$ clang -Wall -std=c99 vla-bug.c && ./a.out
 test_static: size 15  diff 15
    test_var: size 15  diff 75
Comment 1 Jed Brown 2010-11-08 12:42:35 PST
Created attachment 5748 [details]
Test case

looks like this didn't go through with the initial submission
Comment 2 Argyrios Kyrtzidis 2010-11-08 19:32:45 PST
Fixed at r118468.