http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56167



             Bug #: 56167

           Summary: ICE with invalid __attribute__ arguments

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Severity: minor

          Priority: P3

         Component: middle-end

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: d.g.gorbac...@gmail.com





$ 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")));

 ^

Reply via email to