...as suggested by Richard. This means that out-of-range shift values produce the same results on all targets at the tree level. The rtl level isn't affected since it explicitly truncates the count.
Tested on mips64-linux-gnu. OK to install? Thanks, Richard gcc/ * double-int.c (lshift_double, rshift_double): Remove SHIFT_COUNT_TRUNCATED handling. Index: gcc/double-int.c =================================================================== --- gcc/double-int.c 2013-09-28 09:41:49.490113799 +0100 +++ gcc/double-int.c 2013-11-04 15:49:56.963164424 +0000 @@ -20,7 +20,7 @@ Free Software Foundation; either version #include "config.h" #include "system.h" #include "coretypes.h" -#include "tm.h" /* For SHIFT_COUNT_TRUNCATED. */ +#include "tm.h" /* For BITS_PER_UNIT and *_BIG_ENDIAN. */ #include "tree.h" static int add_double_with_sign (unsigned HOST_WIDE_INT, HOST_WIDE_INT, @@ -237,9 +237,6 @@ rshift_double (unsigned HOST_WIDE_INT l1 ? -((unsigned HOST_WIDE_INT) h1 >> (HOST_BITS_PER_WIDE_INT - 1)) : 0); - if (SHIFT_COUNT_TRUNCATED) - count %= prec; - if (count >= HOST_BITS_PER_DOUBLE_INT) { /* Shifting by the host word size is undefined according to the @@ -295,9 +292,6 @@ lshift_double (unsigned HOST_WIDE_INT l1 { unsigned HOST_WIDE_INT signmask; - if (SHIFT_COUNT_TRUNCATED) - count %= prec; - if (count >= HOST_BITS_PER_DOUBLE_INT) { /* Shifting by the host word size is undefined according to the