[patch] builtins.c, fold-const.c: Don't create type

Chris Lattner sabre@nondot.org
Mon Apr 18 00:25:00 GMT 2005


On Sun, 17 Apr 2005, Mark Mitchell wrote:

> Steven Bosscher wrote:
>
>> On IRC, Chris Lattner mentioned (if I understood him correctly) that in
>> LLVM this kind of pointer arithmetic doesn't exist, and that instead it
>> is converted to "regular" integer arithmatic by casting the pointer to
>> intptr_t (instead of casting the integer to a pointer).  Would that be
>> a better solution for GCC too, perhaps?
>
> It will not be fun to support 32-bit pointers on Itanium or PA with LLVM, as 
> integer arithmetic does not quite do the right thing.  You have to fiddle 
> with high-order bits in the pointer as well, so you would have to insert 
> explicit shift/mask operations.  In order to get good code, you have to 
> generate "addp4" rather than just integer addition, and that means keeping 
> track of what's a pointer and what isn't.

Exactly, which is why we don't do the above. :)

-Chris

-- 
http://nondot.org/sabre/
http://llvm.cs.uiuc.edu/



More information about the Gcc-patches mailing list