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: PR target/19890 - gcc.dg/20020219-1.c fails on IA64HP-UX


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


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