This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR33168, ppc64 bootstrap failure


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]