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] builtins.c, fold-const.c: Don't create type


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.


--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304


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