[Bug optimization/12324] [3.4 Regression] [unti-at-a-time] not emitting function referenced from a compound statement

hubicka at ucw dot cz gcc-bugzilla@gcc.gnu.org
Fri Sep 26 09:48:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From hubicka at ucw dot cz  2003-09-26 08:43 -------
Subject: Re:  [3.4 Regression] [unti-at-a-time] not emitting function referenced from a compound statement

> PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12324
> 
> 
> 
> ------- Additional Comments From bernie at develer dot com  2003-09-25 20:48 -------
> Not sure if it's the same bug, but 3.4 outputs
> nothing for this code with -O2:
> 
>   static int foo __attribute__((unused)) = 42;
> 
> This breaks the Linux kernel (the __setup() macro).
> GCC 3.3.1 did the right thing:
> 
>         .data
>         .align 4
>         .type   foo, @object
>         .size   foo, 4
> foo:
>         .long   42

You shall use attribute used here.  Attribute unused merely supress the
warning, while attribute used makes it to be output.  I will look into
the other problem.
Note that attribute used did not work for variables for older GCC, so
you need ifdef machinery.

Honza
> 
> 
> 
> ------- 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 Gcc-bugs mailing list