This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR33168, ppc64 bootstrap failure
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Richard Sandiford <rsandifo at nildram dot co dot uk>
- Cc: gcc-patches at gcc dot gnu dot org, Richard Guenther <rguenther at suse dot de>
- Date: Tue, 23 Oct 2007 01:25:31 +0200
- Subject: Re: [PATCH] Fix PR33168, ppc64 bootstrap failure
- References: <Pine.LNX.4.64.0710221752110.4086@zhemvz.fhfr.qr> <87y7dusvw8.fsf@firetop.home>
This patch from Segher fixes the bootstrap failure on ppc64.
I think this patch is papering over the real bug. It isn't legitimate
to mix read-write and read-only section statements. E.g.:
.section .foo,"a",@progbits
.section .foo,"aw",@progbits
Yes.
produces an unconditional warning:
Warning: ignoring changed section attributes for .foo
so it seems dangerous for gcc to allow it, especially in cases where
the
user hasn't even used section attributes.
My patch was _supposed_ to only do this when there _is_ a section
attribute on both declarations. I think I messed that up though,
which is why I haven't been pushing this patch anymore.
I _do_ still think that when the compiler decides a user-declared
section
should be r/w because of one declaration, but r/o is "good enough" for
another, it should make the section r/w; i.e., from gcc.dg/20051207.c:
int a __attribute__((section (".eh_frame"))) = 1;
const int b __attribute__((section (".eh_frame"))) = 1;
shouldn't fail.
There really should be syntax for the user to specify section attributes
directly.
It sounds like the real bug is what Alan describes in comment #11,
namely that the front end is changing something's visiblity after
having created RTL for it.
Looks like it yes.
Btw, did the patch in comment #8 ever get backported to 4.2? Without
it,
compiling the Linux kernel fails for many configs (on ppc64).
Segher