This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/12324] [3.4 Regression] [unti-at-a-time] not emitting function referenced from a compound statement
- From: "hubicka at ucw dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Sep 2003 20:13:16 -0000
- Subject: [Bug optimization/12324] [3.4 Regression] [unti-at-a-time] not emitting function referenced from a compound statement
- References: <20030918042646.12324.bernie@develer.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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 20:13 -------
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-26 16:29 -------
> Subject: Re: [3.4 Regression] [unti-at-a-time] not
> emitting function referenced from a compound statement
>
> hubicka at ucw dot cz wrote:
>
> >>------- 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.
>
> Yes, I tried and it works. The documentation does not mention attribute
> used for variables. I think it should be fixed.
>
> > I will look into the other problem.
>
> Thanks. That one also breaks the Linux kernel (drivers/net/fec.c uses
> an idiom similar to the test case).
>
> > Note that attribute used did not work for variables for older GCC, so
> > you need ifdef machinery.
>
> Do you know the exact GCC version that introduced it? I'd like to provide
> a patch for the kernel. I can only confirm that 'used' works in 3.3.1 for
> variables.
I believe it actually is 3.3.1. It is safe to test for that version as
no earlier version elliminated unused variables.
Honza
>
>
>
>
>
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.