[Bug tree-optimization/43209] [4.5 Regression] ICE in try_improve_iv_set, at tree-ssa-loop-ivopts.c:5238
--- Comment #11 from hjl at gcc dot gnu dot org 2010-03-13 16:59 --- Subject: Bug 43209 Author: hjl Date: Sat Mar 13 16:58:19 2010 New Revision: 157426 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=157426 Log: Backport testcases from mainline. 2010-03-13 H.J. Lu hongjiu...@intel.com Backport from mainline: 2010-03-11 Martin Jambor mjam...@suse.cz PR tree-optimization/43257 * g++.dg/torture/pr43257.C: New test. 2010-03-11 Richard Guenther rguent...@suse.de PR tree-optimization/43255 * gcc.c-torture/compile/pr43255.c: New testcase. 2010-03-11 Andreas Krebbel andreas.kreb...@de.ibm.com * gcc.dg/pr43280.c: New testcase. 2010-03-10 Jan Hubicka j...@suse.cz * gcc.c-torture/compile/pr43288.c: New test. 2010-03-10 Andrey Belevantsev a...@ispras.ru PR middle-end/42859 * g++.dg/eh/pr42859.C: New test. 2010-03-09 Jakub Jelinek ja...@redhat.com PR debug/43299 * gcc.dg/pr43299.c: New test. 2010-03-08 Richard Guenther rguent...@suse.de PR tree-optimization/43269 * gcc.c-torture/execute/pr43269.c: New testcase. 2010-03-04 Martin Jambor mjam...@suse.cz PR tree-optimization/43164 PR tree-optimization/43191 * gcc.c-torture/compile/pr43164.c: New test. * gcc.c-torture/compile/pr43191.c: Likewise. 2010-03-04 Changpeng Fang changpeng.f...@amd.com PR middle-end/43209 * gcc.dg/tree-ssa/ivopts-4.c: New. 2010-03-03 Jakub Jelinek ja...@redhat.com PR debug/43229 * gfortran.dg/pr43229.f90: New test. PR debug/43237 * gcc.dg/debug/dwarf2/pr43237.c: New test. 2010-03-02 Paul Thomas pa...@gcc.gnu.org PR fortran/43180 * gfortran.dg/internal_pack_10.f90: New test. 2010-02-26 Richard Guenther rguent...@suse.de PR tree-optimization/43188 * gcc.c-torture/compile/pr43188.c: New testcase. 2010-02-25 Jakub Jelinek ja...@redhat.com PR debug/43166 * gfortran.dg/debug/pr43166.f: New test. PR debug/43165 * gcc.dg/torture/pr43165.c: New test. 2010-02-23 Jakub Jelinek ja...@redhat.com PR target/43107 * gcc.target/i386/pr43107.c: New test. Added: branches/gcc-4_4-branch/gcc/testsuite/g++.dg/eh/pr42859.C - copied unchanged from r157425, trunk/gcc/testsuite/g++.dg/eh/pr42859.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/torture/pr43257.C - copied unchanged from r157425, trunk/gcc/testsuite/g++.dg/torture/pr43257.C branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr43164.c - copied unchanged from r157425, trunk/gcc/testsuite/gcc.c-torture/compile/pr43164.c branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr43188.c - copied unchanged from r157425, trunk/gcc/testsuite/gcc.c-torture/compile/pr43188.c branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr43191.c - copied unchanged from r157425, trunk/gcc/testsuite/gcc.c-torture/compile/pr43191.c branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr43255.c - copied unchanged from r157425, trunk/gcc/testsuite/gcc.c-torture/compile/pr43255.c branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr43288.c - copied unchanged from r157425, trunk/gcc/testsuite/gcc.c-torture/compile/pr43288.c branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/execute/pr43269.c - copied unchanged from r157425, trunk/gcc/testsuite/gcc.c-torture/execute/pr43269.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/debug/dwarf2/pr43237.c - copied unchanged from r157425, trunk/gcc/testsuite/gcc.dg/debug/dwarf2/pr43237.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr43280.c - copied unchanged from r157425, trunk/gcc/testsuite/gcc.dg/pr43280.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr43299.c - copied unchanged from r157425, trunk/gcc/testsuite/gcc.dg/pr43299.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/torture/pr43165.c - copied unchanged from r157425, trunk/gcc/testsuite/gcc.dg/torture/pr43165.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/tree-ssa/ivopts-4.c - copied unchanged from r157425, trunk/gcc/testsuite/gcc.dg/tree-ssa/ivopts-4.c branches/gcc-4_4-branch/gcc/testsuite/gcc.target/i386/pr43107.c - copied unchanged from r157425, trunk/gcc/testsuite/gcc.target/i386/pr43107.c branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/debug/pr43166.f - copied unchanged from r157425, trunk/gcc/testsuite/gfortran.dg/debug/pr43166.f branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/internal_pack_10.f90 - copied unchanged from r157425, trunk/gcc/testsuite/gfortran.dg/internal_pack_10.f90 branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/pr43229.f90 - copied unchanged from r157425,
[Bug tree-optimization/43209] [4.5 Regression] ICE in try_improve_iv_set, at tree-ssa-loop-ivopts.c:5238
--- Comment #9 from spop at gcc dot gnu dot org 2010-03-04 12:13 --- Subject: Bug 43209 Author: spop Date: Thu Mar 4 12:12:50 2010 New Revision: 157217 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=157217 Log: Fix PR43209: Do not decrease the cost of an IV candidate when the cost is infinite. 2010-03-03 Changpeng Fang changpeng.f...@amd.com PR middle-end/43209 * tree-ssa-loop-ivopts.c (determine_use_iv_cost_condition): Do not decrease the cost of an IV candidate when the cost is infinite. * gcc.dg/tree-ssa/ivopts-4.c: New. Added: trunk/gcc/testsuite/gcc.dg/tree-ssa/ivopts-4.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-loop-ivopts.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43209
[Bug tree-optimization/43209] [4.5 Regression] ICE in try_improve_iv_set, at tree-ssa-loop-ivopts.c:5238
--- Comment #10 from spop at gcc dot gnu dot org 2010-03-04 12:14 --- Fixed. -- spop at gcc dot gnu dot org changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43209
[Bug tree-optimization/43209] [4.5 Regression] ICE in try_improve_iv_set, at tree-ssa-loop-ivopts.c:5238
--- Comment #8 from pinskia at gcc dot gnu dot org 2010-03-02 20:58 --- *** Bug 43238 has been marked as a duplicate of this bug. *** -- pinskia at gcc dot gnu dot org changed: What|Removed |Added CC||il dot basso dot buffo at ||gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43209
[Bug tree-optimization/43209] [4.5 Regression] ICE in try_improve_iv_set, at tree-ssa-loop-ivopts.c:5238
-- rguenth at gcc dot gnu dot org changed: What|Removed |Added Keywords||ice-on-valid-code Priority|P3 |P1 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43209
[Bug tree-optimization/43209] [4.5 Regression] ICE in try_improve_iv_set, at tree-ssa-loop-ivopts.c:5238
--- Comment #5 from changpeng dot fang at amd dot com 2010-03-01 18:02 --- I have a fix for this problem. We should not decrease the cost if the cost is infinite. diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 74dadf7..9accda9 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -4124,7 +4124,11 @@ determine_use_iv_cost_condition (struct ivopts_data *data, if (integer_zerop (*bound_cst) (operand_equal_p (*control_var, cand-var_after, 0) || operand_equal_p (*control_var, cand-var_before, 0))) -elim_cost.cost -= 1; +{ + /* Should not decrease the cost if it is infinite */ + if (!infinite_cost_p (elim_cost)) +elim_cost.cost -= 1; +} -- changpeng dot fang at amd dot com changed: What|Removed |Added CC||changpeng dot fang at amd ||dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43209
[Bug tree-optimization/43209] [4.5 Regression] ICE in try_improve_iv_set, at tree-ssa-loop-ivopts.c:5238
--- Comment #6 from sebpop at gmail dot com 2010-03-01 18:10 --- Subject: Re: [4.5 Regression] ICE in try_improve_iv_set, at tree-ssa-loop-ivopts.c:5238 On Mon, Mar 1, 2010 at 12:02, changpeng dot fang at amd dot com I have a fix for this problem. We should not decrease the cost if the cost is infinite. Looks good. Thanks for fixing this. Please test with the minor modification below, and submit a patch to gcc-patches@ diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 74dadf7..9accda9 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -4124,7 +4124,11 @@ determine_use_iv_cost_condition (struct ivopts_data *data, if (integer_zerop (*bound_cst) (operand_equal_p (*control_var, cand-var_after, 0) || operand_equal_p (*control_var, cand-var_before, 0))) - elim_cost.cost -= 1; + { + /* Should not decrease the cost if it is infinite */ + if (!infinite_cost_p (elim_cost)) You should fuse this condition into the previous condition expression to avoid the inner if. + elim_cost.cost -= 1; + } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43209
[Bug tree-optimization/43209] [4.5 Regression] ICE in try_improve_iv_set, at tree-ssa-loop-ivopts.c:5238
--- Comment #7 from sebpop at gmail dot com 2010-03-01 18:21 --- Subject: Re: [4.5 Regression] ICE in try_improve_iv_set, at tree-ssa-loop-ivopts.c:5238 You should fuse this condition into the previous condition expression to avoid the inner if. Like this: diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 74dadf7..3b766ed 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -4121,7 +4121,8 @@ determine_use_iv_cost_condition (struct ivopts_data *data, TODO: The constant that we're substracting from the cost should be target-dependent. This information should be added to the target costs for each backend. */ - if (integer_zerop (*bound_cst) + if (!infinite_cost_p (elim_cost) + integer_zerop (*bound_cst) (operand_equal_p (*control_var, cand-var_after, 0) || operand_equal_p (*control_var, cand-var_before, 0))) elim_cost.cost -= 1; -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43209
[Bug tree-optimization/43209] [4.5 Regression] ICE in try_improve_iv_set, at tree-ssa-loop-ivopts.c:5238
--- Comment #2 from zsojka at seznam dot cz 2010-02-28 13:49 --- 4.4 r157120 works fine too testcase doesn't fail at -O2, -O3 (in trunk) -- zsojka at seznam dot cz changed: What|Removed |Added Known to fail||4.5.0 Known to work||4.4.3 Summary|ICE in try_improve_iv_set, |[4.5 Regression] ICE in |at tree-ssa-loop- |try_improve_iv_set, at tree- |ivopts.c:5238 |ssa-loop-ivopts.c:5238 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43209
[Bug tree-optimization/43209] [4.5 Regression] ICE in try_improve_iv_set, at tree-ssa-loop-ivopts.c:5238
--- Comment #3 from hjl dot tools at gmail dot com 2010-02-28 17:02 --- It is caused by revision 156701: http://gcc.gnu.org/ml/gcc-cvs/2010-02/msg00283.html -- hjl dot tools at gmail dot com changed: What|Removed |Added CC||spop at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43209
[Bug tree-optimization/43209] [4.5 Regression] ICE in try_improve_iv_set, at tree-ssa-loop-ivopts.c:5238
--- Comment #4 from amonakov at gcc dot gnu dot org 2010-02-28 22:01 --- Confirmed. The first invocation of get_computation_aff fails with ustep == (long) j, cstep == (unsigned long) j: constant_multiple_of (ustep, cstep, rat) returns false (j is int, STRIP_NOPS ({u,c}step) preserves conversions). -- amonakov at gcc dot gnu dot org changed: What|Removed |Added CC||amonakov at gcc dot gnu dot ||org Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2010-02-28 22:01:43 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43209
[Bug tree-optimization/43209] [4.5 Regression] ICE in try_improve_iv_set, at tree-ssa-loop-ivopts.c:5238
-- hjl dot tools at gmail dot com changed: What|Removed |Added Target Milestone|--- |4.5.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43209