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]

Re: `$' in identifiers -vs- PPC Linux


> 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.

> > > > 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.

-- 
- Geoffrey Keating <geoffk@cygnus.com>

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