From 67a2f76d4c054da755bd23ef9a08854b3340b715 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 10 Mar 2011 19:10:14 +0100 Subject: [PATCH] re PR debug/48043 (pr47201: var-tracking loc_order_check fails for type punning examples) PR debug/48043 * config/s390/s390.c (s390_delegitimize_address): Make sure the result mode matches original rtl mode. From-SVN: r170851 --- gcc/ChangeLog | 6 ++++++ gcc/config/s390/s390.c | 23 ++++++++++++++++------- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 12c74a15eb9..ca2a952d616 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-03-10 Jakub Jelinek + + PR debug/48043 + * config/s390/s390.c (s390_delegitimize_address): Make sure the + result mode matches original rtl mode. + 2011-03-10 Nick Clifton * config/rx/rx.md (bitset_in_memory, bitclr_in_memory: Fix timings. diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 54632ddf9d6..4a056d5863a 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -5027,20 +5027,29 @@ s390_delegitimize_address (rtx orig_x) y = XEXP (XEXP (x, 1), 0); if (GET_CODE (y) == UNSPEC && XINT (y, 1) == UNSPEC_GOT) - return XVECEXP (y, 0, 0); - return orig_x; + y = XVECEXP (y, 0, 0); + else + return orig_x; } - - if (GET_CODE (x) == CONST) + else if (GET_CODE (x) == CONST) { y = XEXP (x, 0); if (GET_CODE (y) == UNSPEC && XINT (y, 1) == UNSPEC_GOTENT) - return XVECEXP (y, 0, 0); - return orig_x; + y = XVECEXP (y, 0, 0); + else + return orig_x; } + else + return orig_x; - return orig_x; + if (GET_MODE (orig_x) != Pmode) + { + y = lowpart_subreg (GET_MODE (orig_x), y, Pmode); + if (y == NULL_RTX) + return orig_x; + } + return y; } /* Output operand OP to stdio stream FILE. -- 2.34.1