[LLVMbugs] [Bug 1233] NEW: multi-dimensional VLA indicies not scaled by llvm-gcc
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Thu Mar 1 09:12:06 PST 2007
http://llvm.org/bugs/show_bug.cgi?id=1233
Summary: multi-dimensional VLA indicies not scaled by llvm-gcc
Product: tools
Version: 1.9
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: llvm-gcc
AssignedTo: unassignedbugs at nondot.org
ReportedBy: djg at cray.com
I typed this into the online demo:
int foo(int v, int w, int x, int y, int z,
float A[][w][x][y][z],
int g, int h, int i, int j, int k)
{
return A[g][h][i][j][k];
}
It gave me this:
int %foo(int %v, int %w, int %x, int %y, int %z, float* %A, int %g, int %h, int
%i, int %j, int %k) {
entry:
%tmp64.sum = add int %h, %g ; <int> [#uses=1]
%tmp62.sum = add int %tmp64.sum, %i ; <int> [#uses=1]
%tmp60.sum = add int %tmp62.sum, %j ; <int> [#uses=1]
%tmp54.sum = add int %tmp60.sum, %k ; <int> [#uses=1]
%tmp66 = getelementptr float* %A, int %tmp54.sum ; <float*> [#uses=1]
%tmp = load float* %tmp66 ; <float> [#uses=1]
%tmp67 = cast float %tmp to int ; <int> [#uses=1]
ret int %tmp67
}
The VLA indicies are not being scaled; it's just adding them all up verbatim and
doing a one-dimensional getelementptr.
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
More information about the llvm-bugs
mailing list