This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH PR31490] Re: another build failure on ppc64-linux
- From: Richard Sandiford <richard at codesourcery dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: janis187 at us dot ibm dot com, "gcc-patches\ at gcc dot gnu dot org Patches" <gcc-patches at gcc dot gnu dot org>, GCC List <gcc at gcc dot gnu dot org>
- Date: Wed, 05 Sep 2007 18:18:23 +0100
- Subject: Re: [PATCH PR31490] Re: another build failure on ppc64-linux
- References: <1188257157.9813.12.camel@janis-laptop> <3e48b8a01451a1664664b949855fb366@kernel.crashing.org>
Thanks for looking at this.
Segher Boessenkool <segher@kernel.crashing.org> writes:
> + /* Allow mixed writable and read-only objects in named
> sections. */
> + if ((sect->common.flags & SECTION_NAMED) != 0
> + && ((sect->common.flags ^ flags) & ~SECTION_DECLARED)
> + == SECTION_WRITE)
> + {
> + sect->common.flags |= SECTION_WRITE;
> + return sect;
> + }
> +
The SECTION_NAMED check is redundant; this function only deals with
named sections. FWIW, I think it would be cleaner to put:
if (((sect->common.flags ^ flags) & SECTION_WRITE) != 0)
sect->common.flags |= SECTION_WRITE;
before:
if ((sect->common.flags & ~SECTION_DECLARED) != flags
&& ((sect->common.flags | flags) & SECTION_OVERRIDE) == 0)
{
/* Sanity check user variables for flag changes. */
if (decl == 0)
decl = sect->named.decl;
gcc_assert (decl);
error ("%+D causes a section type conflict", decl);
}
Do we want to still complain when the section has been declared
(i.e. when SECTION_DECLARED is set)? Or do we just leave that
to the assembler?
IMO, the system_error.lo case is genuine bug; it's picking a section
for a read-only variable before marking it as read-only. So for this
case, I think the patch is actually papering over a real problem.
(That's not an objection to the patch though.)
Richard