Hi! My recent changes to UNSPEC handling in dwarf2out.c apparently broke (non-release checking) regtest on powerpc*, a lot of note: non-delegitimized UNSPEC UNSPEC_FUSION_GPR (73) found in variable location messages are emitted while compiling pretty much anything with -mcpu=power8 or later.
The problem is that debug insns say some variable lives in the result of UNSPEC_FUSION_GPR and var-tracking manages to optimize the operand of that UNSPEC from a complex MEM into a LABEL_REF. For UNSPECs that don't have any constant arguments dwarf2out is silent as before, but for those that have CONSTANT_P operands it hints that it would be nice to delegitimize those. Apparently UNSPEC_FUSION_GPR wraps a MEM that isn't valid in a normal insn, as it includes both the high and lo_sum parts, but otherwise it is something that is completely ok for debug info purposes. So, this patch delegitimizes this UNSPEC to its argument. Bootstrapped/regtested on powerpc64le-linux, ok for trunk? 2019-01-08 Jakub Jelinek <ja...@redhat.com> * config/rs6000/rs6000.c (rs6000_delegitimize_address): Delegitimize UNSPEC_FUSION_GPR to its argument. Formatting fixes. --- gcc/config/rs6000/rs6000.c.jj 2019-01-01 12:37:44.885520010 +0100 +++ gcc/config/rs6000/rs6000.c 2019-01-08 13:22:48.846995153 +0100 @@ -8388,14 +8388,17 @@ rs6000_delegitimize_address (rtx orig_x) { rtx x, y, offset; + if (GET_CODE (orig_x) == UNSPEC && XINT (orig_x, 1) == UNSPEC_FUSION_GPR) + orig_x = XVECEXP (orig_x, 0, 0); + orig_x = delegitimize_mem_from_attrs (orig_x); + x = orig_x; if (MEM_P (x)) x = XEXP (x, 0); y = x; - if (TARGET_CMODEL != CMODEL_SMALL - && GET_CODE (y) == LO_SUM) + if (TARGET_CMODEL != CMODEL_SMALL && GET_CODE (y) == LO_SUM) y = XEXP (y, 1); offset = NULL_RTX; @@ -8407,8 +8410,7 @@ rs6000_delegitimize_address (rtx orig_x) y = XEXP (y, 0); } - if (GET_CODE (y) == UNSPEC - && XINT (y, 1) == UNSPEC_TOCREL) + if (GET_CODE (y) == UNSPEC && XINT (y, 1) == UNSPEC_TOCREL) { y = XVECEXP (y, 0, 0); @@ -8435,8 +8437,7 @@ rs6000_delegitimize_address (rtx orig_x) && GET_CODE (XEXP (orig_x, 1)) == CONST) { y = XEXP (XEXP (orig_x, 1), 0); - if (GET_CODE (y) == UNSPEC - && XINT (y, 1) == UNSPEC_MACHOPIC_OFFSET) + if (GET_CODE (y) == UNSPEC && XINT (y, 1) == UNSPEC_MACHOPIC_OFFSET) return XVECEXP (y, 0, 0); } Jakub