From: Vladimir Makarov Date: Wed, 21 Nov 2012 22:22:11 +0000 (+0000) Subject: re PR rtl-optimization/55414 (spec2006 416.gamess compilation fails on LRA) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1966c91bf487448902f93c9f54e6dab45640ca52;p=gcc.git re PR rtl-optimization/55414 (spec2006 416.gamess compilation fails on LRA) 2012-11-21 Vladimir Makarov PR rtl-optimization/55414 * lra-constraints.c (Index): New function. (lra_constraints): Check dead equiv init insns. From-SVN: r193712 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fc4e5bc3538..7476b8634da 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-11-21 Vladimir Makarov + + PR rtl-optimization/55414 + * lra-constraints.c (Index): New function. + (lra_constraints): Check dead equiv init insns. + 2012-11-21 Richard Henderson * config/alpha/alpha.md (extvmisaligndi): Rename from extv; update diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index 63ef155bd45..7fbd3d5e7fe 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -3215,6 +3215,17 @@ multi_block_pseudo_p (int regno) return false; } +/* Return true if LIST contains a deleted insn. */ +static bool +contains_deleted_insn_p (rtx list) +{ + for (; list != NULL_RTX; list = XEXP (list, 1)) + if (NOTE_P (XEXP (list, 0)) + && NOTE_KIND (XEXP (list, 0)) == NOTE_INSN_DELETED) + return true; + return false; +} + /* Return true if X contains a pseudo dying in INSN. */ static bool dead_pseudo_p (rtx x, rtx insn) @@ -3317,10 +3328,29 @@ lra_constraints (bool first_p) bool pseudo_p = contains_reg_p (x, false, false); rtx set, insn; - /* We don't use DF for compilation speed sake. So it is - problematic to update live info when we use an - equivalence containing pseudos in more than one BB. */ - if ((pseudo_p && multi_block_pseudo_p (i)) + /* After RTL transformation, we can not guarantee that + pseudo in the substitution was not reloaded which might + make equivalence invalid. For example, in reverse + equiv of p0 + + p0 <- ... + ... + equiv_mem <- p0 + + the memory address register was reloaded before the 2nd + insn. */ + if ((! first_p && pseudo_p) + /* We don't use DF for compilation speed sake. So it + is problematic to update live info when we use an + equivalence containing pseudos in more than one + BB. */ + || (pseudo_p && multi_block_pseudo_p (i)) + /* If an init insn was deleted for some reason, cancel + the equiv. We could update the equiv insns after + transformations including an equiv insn deletion + but it is not worthy as such cases are extremely + rare. */ + || contains_deleted_insn_p (ira_reg_equiv[i].init_insns) /* If it is not a reverse equivalence, we check that a pseudo in rhs of the init insn is not dying in the insn. Otherwise, the live info at the beginning of @@ -3335,19 +3365,6 @@ lra_constraints (bool first_p) && (int) REGNO (SET_DEST (set)) == i) && init_insn_rhs_dead_pseudo_p (i))) ira_reg_equiv[i].defined_p = false; - else if (! first_p && pseudo_p) - /* After RTL transformation, we can not guarantee that - pseudo in the substitution was not reloaded which - might make equivalence invalid. For example, in - reverse equiv of p0 - - p0 <- ... - ... - equiv_mem <- p0 - - the memory address register was reloaded before the - 2nd insn. */ - ira_reg_equiv[i].defined_p = false; if (contains_reg_p (x, false, true)) ira_reg_equiv[i].profitable_p = false; if (get_equiv_substitution (reg) != reg)