From dcc1e1fab49e2b2d000b22f0053c0ffe53c44b14 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 21 Dec 2009 17:32:44 +0100 Subject: [PATCH] re PR rtl-optimization/42429 (Miscompilation of 2fish on s390) PR rtl-optimization/42429 * reload.c (find_reloads_subreg_address): When adjusting mode of MEM, update also MEM_SIZE if it is set. From-SVN: r155374 --- gcc/ChangeLog | 6 ++++++ gcc/reload.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7eef1e8400f..4dde7e48f03 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-12-21 Jakub Jelinek + + PR rtl-optimization/42429 + * reload.c (find_reloads_subreg_address): When adjusting mode of + MEM, update also MEM_SIZE if it is set. + 2009-12-21 H.J. Lu PR bootstrap/42345 diff --git a/gcc/reload.c b/gcc/reload.c index 97c6bacf25b..4601b4aeacd 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -6149,6 +6149,9 @@ find_reloads_subreg_address (rtx x, int force_replace, int opnum, PUT_MODE (tem, GET_MODE (x)); if (MEM_OFFSET (tem)) set_mem_offset (tem, plus_constant (MEM_OFFSET (tem), offset)); + if (MEM_SIZE (tem) + && INTVAL (MEM_SIZE (tem)) != (HOST_WIDE_INT) outer_size) + set_mem_size (tem, GEN_INT (outer_size)); /* If this was a paradoxical subreg that we replaced, the resulting memory must be sufficiently aligned to allow