From 00eea35e8107e50c4a5f569385646ae09f4e47fc Mon Sep 17 00:00:00 2001 From: Steve Ellcey Date: Tue, 2 Jun 2015 09:20:30 -0700 Subject: Fix bug where force_const_mem may return NULL_RTX. Change-Id: I54a6469aa140e7b24853237ac51398f8e8f4ea95 --- gcc-4.9/gcc/explow.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc-4.9/gcc/explow.c b/gcc-4.9/gcc/explow.c index 48e91a644..4e0aedf6b 100644 --- a/gcc-4.9/gcc/explow.c +++ b/gcc-4.9/gcc/explow.c @@ -137,7 +137,9 @@ plus_constant (enum 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; -- cgit v1.2.3