http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52355
Bug #: 52355
Summary: [4.7 regression] address difference between array
elements is not considered to be a compile time
constant anymore
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: [email protected]
ReportedBy: [email protected]
Created attachment 26733
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26733
test.c
gcc version 4.7.0 20120223 (experimental) (GCC)
$ cat test.c
void f(char a[16][16][16])
{
asm volatile ("" : : "i" (&a[1][0][0] - &a[0][0][0]));
}
int main(void)
{
char a[16][16][16];
f(a);
return 0;
}
$ gcc -O2 test.c
test.c: In function ‘f’:
test.c:3:5: warning: asm operand 0 probably doesn’t match constraints [enabled
by default]
test.c:3:5: error: impossible constraint in ‘asm’