Bug 49014 - [4.7 Regression] ICE: in reset_sched_cycles_in_current_ebb, at sel-sched.c:7132 with even more insane set of flags
Summary: [4.7 Regression] ICE: in reset_sched_cycles_in_current_ebb, at sel-sched.c:71...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: 4.7.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2011-05-16 19:29 UTC by Zdenek Sojka
Modified: 2011-07-12 12:13 UTC (History)
3 users (show)

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build:
Known to work:
Known to fail: 4.7.0
Last reconfirmed: 2011-05-17 13:36:29


Attachments
reduced testcase (from gcc.dg/pr45352-3.c) (115 bytes, text/plain)
2011-05-16 19:29 UTC, Zdenek Sojka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2011-05-16 19:29:45 UTC
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
Comment 1 H.J. Lu 2011-05-17 13:36:29 UTC
It is caused by revision 173177:

http://gcc.gnu.org/ml/gcc-cvs/2011-04/msg01373.html
Comment 2 Andrey Belevantsev 2011-05-17 14:20:52 UTC
That patch is most likely just exposed a sel-sched bug or a target bug. I will be looking at it tomorrow.
Comment 3 Andrey Belevantsev 2011-05-19 16:43:04 UTC
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")
Comment 4 Uroš Bizjak 2011-05-19 19:09:44 UTC
(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.
Comment 5 Andrey Belevantsev 2011-05-25 07:59:09 UTC
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
Comment 6 Andrey Belevantsev 2011-06-28 12:46:37 UTC
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
Comment 7 Andrey Belevantsev 2011-07-12 12:12:40 UTC
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
Comment 8 Andrey Belevantsev 2011-07-12 12:13:39 UTC
Fixed.