From 2c19378bd99e09f4ee4876a090a884d25cd4e941 Mon Sep 17 00:00:00 2001 From: Andrew Bennett Date: Wed, 3 Jun 2015 09:15:25 +0000 Subject: [PATCH] Update check after force_const_mem call in the plus_constant function to see if the value returned is not a NULL_RTX. 2015-06-03 Andrew Bennett gcc/ * explow.c (plus_constant): Update check after force_const_mem call to see if the value returned is not a NULL_RTX. From-SVN: r224064 --- gcc/ChangeLog | 5 +++++ gcc/explow.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index baeaef5..4c8c609 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-06-03 Andrew Bennett + + * 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 * ipa.c (symbol_table::remove_unreachable_nodes): Don't diff --git a/gcc/explow.c b/gcc/explow.c index d1a2bf8..8745aea 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -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; -- 2.7.4