http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52611
--- Comment #4 from Steven Bosscher <steven at gcc dot gnu.org> 2012-03-18 16:32:15 UTC --- 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.