From c49609be4fd8751e7295610220889aa20a227dbf Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 29 Aug 2019 10:30:48 +0000 Subject: [PATCH] re PR bootstrap/91580 (i686-{darwin, linux} bootstrap fails after r274926) 2019-08-29 Richard Biener PR bootstrap/91580 * config/i386/i386-features.c (general_scalar_chain::convert_insn): Do not emit scalar copies for debug-insns, instead replace their uses with the reg copy used in the chain or reset them if there is a reaching definition outside of the chain as well. From-SVN: r275030 --- gcc/ChangeLog | 8 +++++++ gcc/config/i386/i386-features.c | 40 ++++++++++++++++++++++++++++++--- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9deb5b0eba3..f94dae24c4d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2019-08-29 Richard Biener + + PR bootstrap/91580 + * config/i386/i386-features.c (general_scalar_chain::convert_insn): + Do not emit scalar copies for debug-insns, instead replace + their uses with the reg copy used in the chain or reset them + if there is a reaching definition outside of the chain as well. + 2019-08-29 Jakub Jelinek PR target/91560 diff --git a/gcc/config/i386/i386-features.c b/gcc/config/i386/i386-features.c index d6a10747857..f3c0eb67ec7 100644 --- a/gcc/config/i386/i386-features.c +++ b/gcc/config/i386/i386-features.c @@ -880,18 +880,52 @@ general_scalar_chain::convert_op (rtx *op, rtx_insn *insn) void general_scalar_chain::convert_insn (rtx_insn *insn) { - /* Generate copies for out-of-chain uses of defs. */ + /* Generate copies for out-of-chain uses of defs and adjust debug uses. */ for (df_ref ref = DF_INSN_DEFS (insn); ref; ref = DF_REF_NEXT_LOC (ref)) if (bitmap_bit_p (defs_conv, DF_REF_REGNO (ref))) { df_link *use; for (use = DF_REF_CHAIN (ref); use; use = use->next) - if (DF_REF_REG_MEM_P (use->ref) - || !bitmap_bit_p (insns, DF_REF_INSN_UID (use->ref))) + if (NONDEBUG_INSN_P (DF_REF_INSN (use->ref)) + && (DF_REF_REG_MEM_P (use->ref) + || !bitmap_bit_p (insns, DF_REF_INSN_UID (use->ref)))) break; if (use) convert_reg (insn, DF_REF_REG (ref), *defs_map.get (regno_reg_rtx [DF_REF_REGNO (ref)])); + else + { + /* If we generated a scalar copy we can leave debug-insns + as-is, if not, we have to adjust them. */ + auto_vec to_reset_debug_insns; + for (use = DF_REF_CHAIN (ref); use; use = use->next) + if (DEBUG_INSN_P (DF_REF_INSN (use->ref))) + { + rtx_insn *debug_insn = DF_REF_INSN (use->ref); + /* If there's a reaching definition outside of the + chain we have to reset. */ + df_link *def; + for (def = DF_REF_CHAIN (use->ref); def; def = def->next) + if (!bitmap_bit_p (insns, DF_REF_INSN_UID (def->ref))) + break; + if (def) + to_reset_debug_insns.safe_push (debug_insn); + else + { + *DF_REF_REAL_LOC (use->ref) + = *defs_map.get (regno_reg_rtx [DF_REF_REGNO (ref)]); + df_insn_rescan (debug_insn); + } + } + /* Have to do the reset outside of the DF_CHAIN walk to not + disrupt it. */ + while (!to_reset_debug_insns.is_empty ()) + { + rtx_insn *debug_insn = to_reset_debug_insns.pop (); + INSN_VAR_LOCATION_LOC (debug_insn) = gen_rtx_UNKNOWN_VAR_LOC (); + df_insn_rescan_debug_internal (debug_insn); + } + } } /* Replace uses in this insn with the defs we use in the chain. */ -- 2.30.2