From a0107bd001ec4bc30b345a157561f27ca4419e0b Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 1 Sep 2014 13:15:41 +0200 Subject: [PATCH] re PR target/62025 (Miscompilation of openssl sha512.c) PR target/62025 * sched-deps.c (add_or_update_dep_1): If ask_dependency_caches returned DEP_PRESENT, make sure to set DEP_MULTIPLE on present_dep. (find_inc): Revert 2014-08-13 change. From-SVN: r214786 --- gcc/ChangeLog | 7 +++++++ gcc/sched-deps.c | 24 +++++++----------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ec0e6c44fd0..d3d8ae54132 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2014-09-01 Jakub Jelinek + + PR target/62025 + * sched-deps.c (add_or_update_dep_1): If ask_dependency_caches + returned DEP_PRESENT, make sure to set DEP_MULTIPLE on present_dep. + (find_inc): Revert 2014-08-13 change. + 2014-09-01 Marek Polacek PR middle-end/61903 diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c index e922a96b7b8..455ed196a1a 100644 --- a/gcc/sched-deps.c +++ b/gcc/sched-deps.c @@ -1235,6 +1235,13 @@ add_or_update_dep_1 (dep_t new_dep, bool resolved_p, switch (ask_dependency_caches (new_dep)) { case DEP_PRESENT: + dep_t present_dep; + sd_iterator_def sd_it; + + present_dep = sd_find_dep_between_no_cache (DEP_PRO (new_dep), + DEP_CON (new_dep), + resolved_p, &sd_it); + DEP_MULTIPLE (present_dep) = 1; return DEP_PRESENT; case DEP_CHANGED: @@ -4765,23 +4772,6 @@ find_inc (struct mem_inc_info *mii, bool backwards) goto next; } - /* The inc instruction could have clobbers, make sure those - registers are not used in mem insn. */ - FOR_EACH_INSN_DEF (def, mii->inc_insn) - if (!reg_overlap_mentioned_p (DF_REF_REG (def), mii->mem_reg0)) - { - df_ref use; - FOR_EACH_INSN_USE (use, mii->mem_insn) - if (reg_overlap_mentioned_p (DF_REF_REG (def), - DF_REF_REG (use))) - { - if (sched_verbose >= 5) - fprintf (sched_dump, - "inc clobber used in store failure.\n"); - goto next; - } - } - newaddr = mii->inc_input; if (mii->mem_index != NULL_RTX) newaddr = gen_rtx_PLUS (GET_MODE (newaddr), newaddr, -- 2.30.2