[PATCH] Remove undefined behaviour from hppa backend
authorJeff Law <law@redhat.com>
Tue, 22 Sep 2015 18:39:10 +0000 (12:39 -0600)
committerJeff Law <law@gcc.gnu.org>
Tue, 22 Sep 2015 18:39:10 +0000 (12:39 -0600)
* config/pa/pa.h (MIN_LEGIT_64BIT_CONST_INT: Avoid undefined
behavior.

From-SVN: r228021

gcc/ChangeLog
gcc/config/pa/pa.h

index cf3152735b73376dea20e100407b5530e7cf887b..53da5896b6d568028a682e46fc877d819268a40b 100644 (file)
@@ -1,3 +1,8 @@
+2015-09-22  Jeff Law  <law@redhat.com>
+
+       * config/pa/pa.h (MIN_LEGIT_64BIT_CONST_INT: Avoid undefined
+       behavior.
+
 2015-09-22  Nathan Sidwell  <nathan@codesourcery.com>
 
        * doc/invoke.texi  (-Wmultiple-inheritance, -Wvirtual-inheritance,
index 9fd036ff79fcbb6867e05232741e21352e775d27..511ea810de6719959c26a94aa054244eddfc7abb 100644 (file)
@@ -814,7 +814,8 @@ extern int may_call_alloca;
    this range are forced to the constant pool prior to reload.  */
 
 #define MAX_LEGIT_64BIT_CONST_INT ((HOST_WIDE_INT) 32 << 31)
-#define MIN_LEGIT_64BIT_CONST_INT ((HOST_WIDE_INT) -32 << 31)
+#define MIN_LEGIT_64BIT_CONST_INT \
+  ((HOST_WIDE_INT)((unsigned HOST_WIDE_INT) -32 << 31))
 #define LEGITIMATE_64BIT_CONST_INT_P(X) \
   ((X) >= MIN_LEGIT_64BIT_CONST_INT && (X) < MAX_LEGIT_64BIT_CONST_INT)