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: [tree-ssa] Merge status


"Joseph S. Myers" <jsm@polyomino.org.uk> writes:

> On Sat, 20 Mar 2004, Andreas Jaeger wrote:
>
>> > #define IXDR_GET_LONG(buf) ((long)IXDR_GET_INT32(buf))
>> 
>> If I use this definition, the assembler code on AMD64 looks different:
>
> First guess as to why there might be different code, the existing
> definition looks like it will zero-extend the unsigned result of ntohl
> while the definition I gave will sign-extend it.  I suspect sign-extension
> is correct (given the separate _U_LONG definitions), but maybe
>
> #define IXDR_GET_LONG(buf) ((long)IXDR_GET_U_INT32(buf))
>
> will be more compatible with the current definition.

Yes, this gives the same code on the one file I tried it on!

So, these two definitions do the trick:
#define IXDR_GET_LONG(buf) ((long)IXDR_GET_U_INT32(buf))
#define IXDR_PUT_LONG(buf, v) ((long)IXDR_PUT_INT32(buf, (long)(v)))

I'll send a patch to the glibc lists.  This means we should have fixed
all problems with glibc compiled for x86-64 (I'll double check
later...).

Thanks a lot!
Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SuSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

Attachment: pgp00000.pgp
Description: PGP signature


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