From b8105705495f00ff9060fea7d70c69009c7a4f96 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Mon, 17 Oct 2016 16:10:42 +0000 Subject: [PATCH] * explow.c (validize_mem): Do not modify the argument in-place. From-SVN: r241247 --- gcc/ChangeLog | 6 +++++- gcc/explow.c | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9acc738accc..2ad0bb5cd4d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2016-10-17 Eric Botcazou + + * explow.c (validize_mem): Do not modify the argument in-place. + 2016-10-17 Thomas Schwinge * tree-streamer.c (record_common_node): Explicitly list expected @@ -95,7 +99,7 @@ (lookup_descr_for_decl): New function. (convert_tramp_reference_op): Deal with descriptors. (build_init_call_stmt): New function extracted from... - (finalize_nesting_tree_1): ...here. Adjust and deal withdescriptors. + (finalize_nesting_tree_1): ...here. Adjust and deal with descriptors. * defaults.h (FUNCTION_ALIGNMENT): Define. (TRAMPOLINE_ALIGNMENT): Set to above instead of FUNCTION_BOUNDARY. * config/i386/i386.h (TARGET_CUSTOM_FUNCTION_DESCRIPTORS): Define. diff --git a/gcc/explow.c b/gcc/explow.c index fbebcbd8e47..1c59c862f93 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -496,9 +496,8 @@ memory_address_addr_space (machine_mode mode, rtx x, addr_space_t as) return x; } -/* If REF is a MEM with an invalid address, change it into a valid address. - Pass through anything else unchanged. REF must be an unshared rtx and - the function may modify it in-place. */ +/* Convert a mem ref into one with a valid memory address. + Pass through anything else unchanged. */ rtx validize_mem (rtx ref) @@ -510,7 +509,8 @@ validize_mem (rtx ref) MEM_ADDR_SPACE (ref))) return ref; - return replace_equiv_address (ref, XEXP (ref, 0), true); + /* Don't alter REF itself, since that is probably a stack slot. */ + return replace_equiv_address (ref, XEXP (ref, 0)); } /* If X is a memory reference to a member of an object block, try rewriting -- 2.30.2