This is the mail archive of the gcc@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: attribute((mode)) pointers broken by STRIP_USELESS_TYPE_CONVERSION



On Oct 20, 2004, at 10:47 AM, Ulrich Weigand wrote:


Hello,

using the __attribute__ ((mode)) feature to declare pointer variables
of non-ptr_mode mode appears to have been broken by tree-ssa.

The following simple test case (on s390x):

struct test;
typedef struct test * __attribute__ ((mode (SI))) test_ptr32;
typedef struct test * test_ptr64;

int
test (test_ptr32 a, test_ptr64 b)
{
  return a == b;
}

aborts in copy_to_mode_reg (explow.c:635) because the tree optimizers
have optimized away the type conversion inserted by the front end,
and pass a direct comparison between different modes to the expander.

Try removing the following condition: /* Pointers and references are equivalent once we get to GENERIC, so strip conversions that just switch between them. */ else if (POINTER_TYPE_P (inner_type) && POINTER_TYPE_P (outer_type) && lang_hooks.types_compatible_p (TREE_TYPE (inner_type), TREE_TYPE (outer_type))) return true;

Note you might also have to fix the C++ front-end's types_compatible_p
also, not to ignore modes.

-- Pinski


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