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: [named-addr-spaces-branch][Patch,committed] Fix C++ bug; Add common pointer target hook


On Sun, Nov 30, 2008 at 11:02:25PM +0100, Richard Guenther wrote:
> I can see a pattern here.  Either this needs a function or, more likely, this
> is broken - why does TYPE_PRECISION not work here?

Yep, I've thought about moving it into a function.  The original code spread
over 5 functions is:

  if (POINTER_TYPE_P (type)
      || TREE_CODE (type) == OFFSET_TYPE)
    prec = POINTER_SIZE;
  else
    prec = TYPE_PRECISION (type);

Or

  if (POINTER_TYPE_P (TREE_TYPE (expr)))
    prec = POINTER_SIZE
  else
    prec = TYPE_PRECISION (TREE_TYPE (expr))

I've just been duplicating the original logic, just adding the test for
named address pointers (and of course modifying it as the code changes).

It does look like precision is correct for pointers (i.e. when -mea64, it is
64 for __ea pointers, and 32 otherwise).  Given that all ports seem to use
HImode, SImode, or DImode for pointers, it isn't surprising.  After my builds
finish, I'll try using TYPE_PRECISION directly.

-- 
Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
meissner@linux.vnet.ibm.com


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