Update check after force_const_mem call in the plus_constant function to see if the...
authorabennett <abennett@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 3 Jun 2015 09:15:25 +0000 (09:15 +0000)
committerabennett <abennett@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 3 Jun 2015 09:15:25 +0000 (09:15 +0000)
2015-06-03  Andrew Bennett  <andrew.bennett@imgtec.com>

gcc/
* explow.c (plus_constant): Update check after force_const_mem call
to see if the value returned is not a NULL_RTX.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@224064 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/explow.c

index baeaef5..4c8c609 100644 (file)
@@ -1,3 +1,8 @@
+2015-06-03  Andrew Bennett  <andrew.bennett@imgtec.com>
+
+       * explow.c (plus_constant): Update check after force_const_mem call 
+       to see if the value returned is not a NULL_RTX.
+
 2015-06-03  Ilya Enkovich  <ilya.enkovich@intel.com>
 
        * ipa.c (symbol_table::remove_unreachable_nodes): Don't
index d1a2bf8..8745aea 100644 (file)
@@ -132,7 +132,9 @@ plus_constant (machine_mode mode, rtx x, HOST_WIDE_INT c,
        {
          tem = plus_constant (mode, get_pool_constant (XEXP (x, 0)), c);
          tem = force_const_mem (GET_MODE (x), tem);
-         if (memory_address_p (GET_MODE (tem), XEXP (tem, 0)))
+         /* Targets may disallow some constants in the constant pool, thus
+            force_const_mem may return NULL_RTX.  */
+         if (tem && memory_address_p (GET_MODE (tem), XEXP (tem, 0)))
            return tem;
        }
       break;