This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: PR target/19890 - gcc.dg/20020219-1.c fails on IA64HP-UX
- From: Zack Weinberg <zack at codesourcery dot com>
- To: sje at cup dot hp dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 25 Mar 2005 11:41:21 -0800
- Subject: Re: Patch: PR target/19890 - gcc.dg/20020219-1.c fails on IA64HP-UX
- References: <200503251931.LAA03516@hpsje.cup.hp.com>
Steve Ellcey <sje@cup.hp.com> writes:
> I think this is an obvious fix so I will check it in if no one objects.
I have no objection.
> I believe the test is technically illegal C, since "x - 1" is not
> pointing at real data. On IA64 HP-UX, in 32 bit mode, this results
> in bad code because GCC assumes that extending a pointer (with the
> IA64 addp4 instruction) and then adding a constant is the same as
> adding a constant and then extending it. This is true for any
> pointer that actually points to real data but the "x - 1" expression
> that is passed in to foo is not pointing at any real data.
It *might* be appropriate to disabuse GCC of this notion. However, it
probably causes better code generation for programs that aren't
playing silly buggers with pointers.
I wonder if we could get away with changing the test case to declare
an actual object of type struct A. It is "only" 381 megabytes, and if
uninitialized, should not cause allocation of that much actual
memory. (Element 9999,9999 would be initialized at runtime.)
zw