Using pointers of non-default mode via __attribute__ ((mode))
produces incorrect code in many cases as the tree optimizers
treat an __attribute__ ((mode) qualified pointer type as
equivalent to the corresponding non-qualified type.
(This is a regression over 3.4 introduced by the tree-ssa merge.)
As an example, the follow code ICEs on s390x-ibm-linux,
because the tree optimizers have removed the required type
conversion as 'useless':
struct test;
typedef int * __attribute__ ((mode (SI))) test_ptr32;
typedef struct test *test_ptr64;
int
test (test_ptr32 *a, test_ptr64 *b)
{
return *a == *b;
}
See the discussion at:
http://gcc.gnu.org/ml/gcc/2004-10/msg00775.html
for more details.
--
Summary: Tree optimizers ignore pointer modes
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: uweigand at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18184