$ cat > bug.c extern void foo(void) __attribute__((target(0))); int main(void) { foo(); return 0; } ^D $ gcc -S bug.c bug.c:1:1: internal compiler error: in ix86_valid_target_attribute_inner_p, at config/i386/i386.c:4226 extern void foo(void) __attribute__((target(0))); ^ [...] $ sed -i s/target/error/ bug.c $ gcc -S bug.c bug.c: In function 'main': bug.c:5:6: internal compiler error: tree check: expected string_cst, have integer_cst in expand_expr_real_1, at expr.c:10191 foo(); ^ [...] $ sed -i s/error/warning/ bug.c $ gcc -S bug.c bug.c: In function 'main': bug.c:5:6: internal compiler error: tree check: expected string_cst, have integer_cst in expand_expr_real_1, at expr.c:10198 foo(); ^ [...] A few other __attribute__ bugs: $ sed -i s/warning/weakref/ bug.c $ gcc -S bug.c bug.c:1:1: error: attribute 'alias' argument not a string extern void foo(void) __attribute__((weakref(0))); ^ bug.c:1:13: warning: 'weakref' attribute should be accompanied with an 'alias' attribute [-Wattributes] extern void foo(void) __attribute__((weakref(0))); ^ $ sed -i s/weakref/section/ bug.c $ gcc -S bug.c bug.c:1:13: error: section attribute not allowed for 'foo' extern void foo(void) __attribute__((section(0))); ^ $ echo 'void *foo(int) __attribute__((alloc_size("1")));' > 1.c $ gcc -S 1.c 1.c:1:1: warning: alloc_size parameter outside range [-Wattributes] void *foo(int) __attribute__((alloc_size("1"))); ^
Your gcc is too old. There is no ICE on the first testcase anymore.
Created attachment 29327 [details] gcc48-pr56167.patch Fix for the attribute warning/error ICEs. No idea why you consider the rest as bugs.
> No idea why you consider the rest as bugs. The diagnostic messages are somewhat confusing. I believe that `weakref', by analogy with `alias', should give: bug.c:1:1: error: attribute 'weakref' argument not a string And the same can be said about `section'. In regard to `alloc_size', I think it could report something like: 1.c:1:1: error: 'alloc_size' parameter is not an integer constant Needless to say, all these things are not of the utmost importance...
Author: jakub Date: Tue Feb 5 08:08:27 2013 New Revision: 195748 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195748 Log: PR middle-end/56167 * c-common.c (handle_error_attribute): Fix condition. * gcc.dg/pr56167.c: New test. Added: trunk/gcc/testsuite/gcc.dg/pr56167.c Modified: trunk/gcc/c-family/ChangeLog trunk/gcc/c-family/c-common.c trunk/gcc/testsuite/ChangeLog
Fixed.