From: Andrey Belevantsev Date: Mon, 1 Apr 2019 18:05:08 +0000 (+0300) Subject: sel-sched: correct reset of reset_sched_cycles_p (PR 85412) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4b52560099c1b744a0e639daea4805fe10fb3219;p=gcc.git sel-sched: correct reset of reset_sched_cycles_p (PR 85412) 2019-04-01 Andrey Belevantsev PR rtl-optimization/85412 * sel-sched.c (sel_sched_region): Assign reset_sched_cycles_p before sel_sched_region_1, not after. * gcc.dg/pr85412.c: New test. From-SVN: r270065 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9afd09bd7d9..7b745c61193 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-04-01 Andrey Belevantsev + + PR rtl-optimization/85412 + * sel-sched.c (sel_sched_region): Assign reset_sched_cycles_p before + sel_sched_region_1, not after. + 2019-04-01 Andrey Belevantsev PR rtl-optimization/86928 diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c index 338d7c097df..552dd0b9263 100644 --- a/gcc/sel-sched.c +++ b/gcc/sel-sched.c @@ -7650,11 +7650,11 @@ sel_sched_region (int rgn) /* Schedule always selecting the next insn to make the correct data for bundling or other later passes. */ pipelining_p = false; + reset_sched_cycles_p = false; force_next_insn = 1; sel_sched_region_1 (); force_next_insn = 0; } - reset_sched_cycles_p = pipelining_p; sel_region_finish (reset_sched_cycles_p); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 244ae87b495..39e393487c4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-04-01 Andrey Belevantsev + + PR rtl-optimization/85412 + * gcc.dg/pr85412.c: New test. + 2019-04-01 Paolo Carlini PR c++/62207 diff --git a/gcc/testsuite/gcc.dg/pr85412.c b/gcc/testsuite/gcc.dg/pr85412.c new file mode 100644 index 00000000000..11b8ceccd1e --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr85412.c @@ -0,0 +1,21 @@ +/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */ +/* { dg-require-effective-target int128 } */ +/* { dg-options "-O1 -fpeephole2 -fschedule-insns2 -fsel-sched-pipelining -fselective-scheduling2 -ftree-loop-if-convert -fno-if-conversion -fno-move-loop-invariants -fno-split-wide-types -fno-tree-dominator-opts" } */ +/* { dg-additional-options "-march=bonnell" { target x86_64-*-* } } */ + +__int128 jv; + +void +zm (__int128 g9, unsigned short int sm, short int hk) +{ + while (hk < 1) + { + if (jv == 0) + sm *= g9; + + if (sm < jv) + hk = sm; + + g9 |= sm == hk; + } +}