http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52611
--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-03-19 10:53:23 UTC --- (In reply to comment #4) > I don't think we should drop a cast that changes a machine mode: > > --- tree-ssa.c.orig 2012-03-18 17:32:32.000000000 +0100 > +++ tree-ssa.c 2012-03-18 17:30:40.000000000 +0100 > @@ -1264,6 +1264,10 @@ useless_type_conversion_p (tree outer_ty > if (POINTER_TYPE_P (inner_type) > && POINTER_TYPE_P (outer_type)) > { > + /* Do not lose casts between pointers in different machine modes. */ > + if (TYPE_MODE (inner_type) != TYPE_MODE (outer_type)) > + return false; > + > /* Do not lose casts between pointers to different address spaces. */ > if (TYPE_ADDR_SPACE (TREE_TYPE (outer_type)) > != TYPE_ADDR_SPACE (TREE_TYPE (inner_type))) > > GCC 4.7 and GCC 4.8 have a similar check in place. Yes, the patch that introduced this can/should be backported.