`$' in identifiers -vs- PPC Linux

Franz Sirl Franz.Sirl-kernel@lauterbach.com
Tue Oct 17 14:08:00 GMT 2000


On Tue, 17 Oct 2000, Geoff Keating wrote:
> > From: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
> > Date: Tue, 17 Oct 2000 21:37:53 +0200
> > Cc: gcc-patches@gcc.gnu.org
> >
> > Well, tell me what do you want to have out of rs6000.h and I'll do
> > the boring work :-). I just couldn't draw a sensible line for all
> > the alignment, type and ASM macros myself.
>
> I think that when the ppc-elf64 stuff comes in all this will need to
> be rearranged anyway, because suddenly we'll have aix-xcoff and
> aix-elf64 and powerpc-elf64.  So there's no need to tinker with it now.

OK :)

> > > > > make no real sense to move into aix.h IMHO.
> > > > >
> > > > > The patch also syncs the ASM_APP_* macros for Linux on PPC and
> > > > > fixes the CONSTRUCTOR handling in rs6000.c. Geoff, related to the
> > > > > CONSTRUCTOR handling I also want to revive execute/20000516-1.c
> > > > > from CVS, this test is meant to pass and is _different_ from
> > > > > execute/20000722-1.c. The test verifies that CONSTRUCTOR data is
> > > > > put into a writeable section. I didn't notice yet that you did
> > > > > remove it, but the removal was wrong.
> > >
> > > The testcase was failing sometimes, and passing sometimes, based I
> > > believe on segment sizes or something, which was annoying.
> > >
> > > The data does not need to be put in a writable section.  It has to be
> > > copied from wherever it is into a local temporary.
> > >
> > > For instance,
> > >
> > > struct s
> > > {
> > >   int value;
> > >   char *string;
> > > };
> > >
> > > int i;
> > > for (i = 0; i < 4; i++)
> > > {
> > >    struct s *t = & (struct s) { 3, "hey there" };
> > >    if (t->value != 3)
> > >      abort();
> > >    t->value = 4;
> > >    if (t->value != 4)
> > >      abort();
> > > }
> >
> > I don't quite understand? This code fails without my patch and passes
> > with it?
>
> No, this code fails on every gcc release to date I believe.  Certainly
> it fails on x86 and ppc with current gcc versions.  But C99 says it
> should pass.
>
> > Note that my patch (or something similar) fixes Linux kernel compilation,
> > without it you can't put a kernel image into ROM, cause it tries to write
> > to it. This is a showstopper for the embedded people. Additionally the
> > same functionality is available on x86, which passed the testcase too.
>
> Your patch fixes this specific problem, but the underlying bug is
> still there, and if the underlying bug was fixed your patch would
> probably be unnecessary.  Your patch is OK for a branch, but not for
> the mainline.
>
> > On what platforms did the test FAIL?
>
> I had to take your test out because it would fail or pass depending on
> the size of crt0, which was confusing the automated tester.  The new
> testcase shows the same underlying problem (that we aren't using
> temporaries) and fails every time.
>
> > I would rather think these need fixes too, that's why the testcase
> > was added in the first place, it tests if the functionality (I think
> > this is a GCC extension) is correctly implemented.
>
> It's now in the ISO C standard, as section 6.5.2.5, with
> better-defined semantics.  The bit that would need changing is
> cast_expr in c-parse.in.

Aaahhh! So you meant to say there _is_ a bug, but it has to be fixed in a 
different way. Fine with me.

Here is the updated patch, OK to commit?

BTW, can you approve this PPC related fix too? It's in my sources for nearly 
a year now and awaits approval :-):
http://gcc.gnu.org/ml/gcc-patches/1999-11n/msg00616.html

Some related discussion can be found here:
http://gcc.gnu.org/ml/gcc-patches/1999-11n/msg00268.html

Franz.

        * rs6000/rs6000.h (NO_DOLLAR_IN_LABEL, DOLLARS_IN_IDENTIFIERS,
        ENCODE_SECTION_INFO, ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Move from
        here...
        * rs6000/aix.h: ...to here.
        * rs6000/linux.h (ASM_APP_ON, ASM_APP_OFF): Define to Linux-style.


More information about the Gcc-patches mailing list