Created attachment 24255 [details] reduced testcase (from gcc.dg/pr45352-3.c) Compiler output: $ gcc testcase.c -O -fprofile-generate -fgcse -fno-gcse-lm -fno-tree-loop-im -funroll-loops -fno-web -fschedule-insns2 -fselective-scheduling2 -fsel-sched-pipelining -fPIC -fno-forward-propagate -ftree-vrp testcase.c: In function 'foo': testcase.c:11:1: internal compiler error: in reset_sched_cycles_in_current_ebb, at sel-sched.c:7132 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. Tested revisions: r173785 - crash 4.6 r173059 - OK 4.5 r173059 - OK
It is caused by revision 173177: http://gcc.gnu.org/ml/gcc-cvs/2011-04/msg01373.html
That patch is most likely just exposed a sel-sched bug or a target bug. I will be looking at it tomorrow.
We again hit an insn with the nothing reservation. This time it is the compare from *cmpfp_iu_sse. It does set the decode attribute to vector correctly but sets type to ssecomi, and in the athlon.md the athlon_ssecomi reservation compares against ssecmp, not ssecomi. I see the following comment there: ;; It seems athlon_ssecomi has a bug in the attr_type, fixed for amdfam10 Changing the type to ssecomi (like below, as in atom.md) fixes this. Uros, does this look right to you? The other ssecomi* reservations also have the ssecomi type. If yes, then I will add the assert to the scheduler which will fire immediately upon detecting this, it will be simple. diff --git a/gcc/config/i386/athlon.md b/gcc/config/i386/athlon.md index 341adf4..2896a15 100644 --- a/gcc/config/i386/athlon.md +++ b/gcc/config/i386/athlon.md @@ -798,7 +798,7 @@ "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_ssecomi" 4 (and (eq_attr "cpu" "athlon,k8,generic64") - (eq_attr "type" "ssecmp")) + (eq_attr "type" "ssecomi")) "athlon-vector,athlon-fpsched,athlon-fadd") (define_insn_reservation "athlon_ssecomi_amdfam10" 3 (and (eq_attr "cpu" "amdfam10")
(In reply to comment #3) > Changing the type to ssecomi (like below, as in atom.md) fixes this. > > Uros, does this look right to you? The other ssecomi* reservations also have > the ssecomi type. If yes, then I will add the assert to the scheduler which > will fire immediately upon detecting this, it will be simple. > > > diff --git a/gcc/config/i386/athlon.md b/gcc/config/i386/athlon.md > index 341adf4..2896a15 100644 > --- a/gcc/config/i386/athlon.md > +++ b/gcc/config/i386/athlon.md > @@ -798,7 +798,7 @@ > "athlon-direct,athlon-fploadk8,athlon-fadd") > (define_insn_reservation "athlon_ssecomi" 4 > (and (eq_attr "cpu" "athlon,k8,generic64") > - (eq_attr "type" "ssecmp")) > + (eq_attr "type" "ssecomi")) > "athlon-vector,athlon-fpsched,athlon-fadd") > (define_insn_reservation "athlon_ssecomi_amdfam10" 3 > (and (eq_attr "cpu" "amdfam10") This change looks correct to me, "ssecmp" type goes to ssecmp* reservations.
Author: abel Date: Wed May 25 07:59:06 2011 New Revision: 174172 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174172 Log: PR rtl-optimization/49014 * config/i386/athlon.md (athlon_ssecomi): Change type to ssecomi. Modified: trunk/gcc/ChangeLog trunk/gcc/config/i386/athlon.md
Author: abel Date: Tue Jun 28 12:46:34 2011 New Revision: 175582 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175582 Log: Backport from mainline 2011-05-25 Andrey Belevantsev <abel@ispras.ru> PR rtl-optimization/49014 * config/i386/athlon.md (athlon_ssecomi): Change type to ssecomi. Modified: branches/gcc-4_6-branch/gcc/ChangeLog branches/gcc-4_6-branch/gcc/config/i386/athlon.md
Author: abel Date: Tue Jul 12 12:12:36 2011 New Revision: 176197 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176197 Log: Backport from mainline 2011-05-25 Andrey Belevantsev <abel@ispras.ru> PR rtl-optimization/49014 * config/i386/athlon.md (athlon_ssecomi): Change type to ssecomi. Modified: branches/gcc-4_5-branch/gcc/ChangeLog branches/gcc-4_5-branch/gcc/config/i386/athlon.md
Fixed.