public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/50205] New: [4.6/4.7 Regression] ICE: in code_motion_path_driver, at sel-sched.c:6581 with -fselective-scheduling2 and custom flags
@ 2011-08-27  2:39 zsojka at seznam dot cz
  2011-08-27  8:11 ` [Bug rtl-optimization/50205] " rguenth at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: zsojka at seznam dot cz @ 2011-08-27  2:39 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50205

             Bug #: 50205
           Summary: [4.6/4.7 Regression] ICE: in code_motion_path_driver,
                    at sel-sched.c:6581 with -fselective-scheduling2 and
                    custom flags
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zsojka@seznam.cz
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu


Created attachment 25115
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25115
reduced testcase

Compiler output:
$ gcc -O2 -fno-cprop-registers -fno-dce -fno-forward-propagate
-fselective-scheduling2 -funroll-loops -fno-web testcase.c         
testcase.c: In function 'foo':
testcase.c:11:1: internal compiler error: in code_motion_path_driver, at
sel-sched.c:6581
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Tested revisions:
r178096 - crash
4.6 r177922 - crash
4.5 r177922 - OK


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug rtl-optimization/50205] [4.6/4.7 Regression] ICE: in code_motion_path_driver, at sel-sched.c:6581 with -fselective-scheduling2 and custom flags
  2011-08-27  2:39 [Bug rtl-optimization/50205] New: [4.6/4.7 Regression] ICE: in code_motion_path_driver, at sel-sched.c:6581 with -fselective-scheduling2 and custom flags zsojka at seznam dot cz
@ 2011-08-27  8:11 ` rguenth at gcc dot gnu.org
  2011-09-06 11:18 ` amonakov at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-08-27  8:11 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50205

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.6.2


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug rtl-optimization/50205] [4.6/4.7 Regression] ICE: in code_motion_path_driver, at sel-sched.c:6581 with -fselective-scheduling2 and custom flags
  2011-08-27  2:39 [Bug rtl-optimization/50205] New: [4.6/4.7 Regression] ICE: in code_motion_path_driver, at sel-sched.c:6581 with -fselective-scheduling2 and custom flags zsojka at seznam dot cz
  2011-08-27  8:11 ` [Bug rtl-optimization/50205] " rguenth at gcc dot gnu.org
@ 2011-09-06 11:18 ` amonakov at gcc dot gnu.org
  2011-10-10 12:29 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: amonakov at gcc dot gnu.org @ 2011-09-06 11:18 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50205

Alexander Monakov <amonakov at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011-09-06
                 CC|                            |abel at gcc dot gnu.org,
                   |                            |amonakov at gcc dot gnu.org
         AssignedTo|unassigned at gcc dot       |amonakov at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #1 from Alexander Monakov <amonakov at gcc dot gnu.org> 2011-09-06 11:17:47 UTC ---
We attempt to substitute an insn like (... (cmp (mem (reg:DI ax)) (reg:SI ax)))
(note different modes) through (set (reg:DI ax) (reg:DI dx)), which leaves the
(reg:SI ax) part of the comparison intact, causing an ICE later on when we
notice that the dependency on ax is still present.  As this is quite rare, we
can simply forbid substitution in such circumstances, much like substitution of
multiple hard reg references is forbidden now.  The patch I'm going to test:

diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c
index f11faca..2af01ae 100644
--- a/gcc/sel-sched.c
+++ b/gcc/sel-sched.c
@@ -813,18 +813,12 @@ count_occurrences_1 (rtx *cur_rtx, void *arg)
 {
   rtx_search_arg_p p = (rtx_search_arg_p) arg;

-  /* The last param FOR_GCSE is true, because otherwise it performs excessive
-    substitutions like
-    r8 = r33
-    r16 = r33
-    for the last insn it presumes r33 equivalent to r8, so it changes it to
-    r33.  Actually, there's no change, but it spoils debugging.  */
-  if (exp_equiv_p (*cur_rtx, p->x, 0, true))
-    {
-      /* Bail out if we occupy more than one register.  */
-      if (REG_P (*cur_rtx)
-          && HARD_REGISTER_P (*cur_rtx)
-          && hard_regno_nregs[REGNO(*cur_rtx)][GET_MODE (*cur_rtx)] > 1)
+  if (REG_P (*cur_rtx) && REGNO (*cur_rtx) == REGNO (p->x))
+    {
+      /* Bail out if mode is different or more than one register is used.  */
+      if (GET_MODE (*cur_rtx) != GET_MODE (p->x)
+          || (HARD_REGISTER_P (*cur_rtx)
+          && hard_regno_nregs[REGNO(*cur_rtx)][GET_MODE (*cur_rtx)] > 1))
         {
           p->n = 0;
           return 1;
@@ -837,7 +831,6 @@ count_occurrences_1 (rtx *cur_rtx, void *arg)
     }

   if (GET_CODE (*cur_rtx) == SUBREG
-      && REG_P (p->x)
       && (!REG_P (SUBREG_REG (*cur_rtx))
       || REGNO (SUBREG_REG (*cur_rtx)) == REGNO (p->x)))
     {
@@ -859,6 +852,7 @@ count_occurrences_equiv (rtx what, rtx where)
 {
   struct rtx_search_arg arg;

+  gcc_assert (REG_P (what));
   arg.x = what;
   arg.n = 0;


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug rtl-optimization/50205] [4.6/4.7 Regression] ICE: in code_motion_path_driver, at sel-sched.c:6581 with -fselective-scheduling2 and custom flags
  2011-08-27  2:39 [Bug rtl-optimization/50205] New: [4.6/4.7 Regression] ICE: in code_motion_path_driver, at sel-sched.c:6581 with -fselective-scheduling2 and custom flags zsojka at seznam dot cz
  2011-08-27  8:11 ` [Bug rtl-optimization/50205] " rguenth at gcc dot gnu.org
  2011-09-06 11:18 ` amonakov at gcc dot gnu.org
@ 2011-10-10 12:29 ` rguenth at gcc dot gnu.org
  2011-10-18 12:36 ` amonakov at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-10-10 12:29 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50205

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug rtl-optimization/50205] [4.6/4.7 Regression] ICE: in code_motion_path_driver, at sel-sched.c:6581 with -fselective-scheduling2 and custom flags
  2011-08-27  2:39 [Bug rtl-optimization/50205] New: [4.6/4.7 Regression] ICE: in code_motion_path_driver, at sel-sched.c:6581 with -fselective-scheduling2 and custom flags zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2011-10-10 12:29 ` rguenth at gcc dot gnu.org
@ 2011-10-18 12:36 ` amonakov at gcc dot gnu.org
  2011-10-18 12:46 ` amonakov at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: amonakov at gcc dot gnu.org @ 2011-10-18 12:36 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50205

--- Comment #2 from Alexander Monakov <amonakov at gcc dot gnu.org> 2011-10-18 12:36:20 UTC ---
Author: amonakov
Date: Tue Oct 18 12:36:16 2011
New Revision: 180135

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=180135
Log:
    PR rtl-optimization/50205
    * sel-sched.c (count_occurrences_1): Simplify on the assumption that
    p->x is a register.  Forbid substitution when the same register is
    found in a different mode.
    (count_occurrences_equiv): Assert that 'what' is a register.

    * gcc.dg/pr50205.c: New.

Added:
    trunk/gcc/testsuite/gcc.dg/pr50205.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/sel-sched.c
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug rtl-optimization/50205] [4.6/4.7 Regression] ICE: in code_motion_path_driver, at sel-sched.c:6581 with -fselective-scheduling2 and custom flags
  2011-08-27  2:39 [Bug rtl-optimization/50205] New: [4.6/4.7 Regression] ICE: in code_motion_path_driver, at sel-sched.c:6581 with -fselective-scheduling2 and custom flags zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2011-10-18 12:36 ` amonakov at gcc dot gnu.org
@ 2011-10-18 12:46 ` amonakov at gcc dot gnu.org
  2011-10-26 17:48 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: amonakov at gcc dot gnu.org @ 2011-10-18 12:46 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50205

Alexander Monakov <amonakov at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P3
      Known to work|                            |4.7.0
      Known to fail|4.7.0                       |

--- Comment #3 from Alexander Monakov <amonakov at gcc dot gnu.org> 2011-10-18 12:45:14 UTC ---
Fixed on the trunk, needs backport to 4.6


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug rtl-optimization/50205] [4.6/4.7 Regression] ICE: in code_motion_path_driver, at sel-sched.c:6581 with -fselective-scheduling2 and custom flags
  2011-08-27  2:39 [Bug rtl-optimization/50205] New: [4.6/4.7 Regression] ICE: in code_motion_path_driver, at sel-sched.c:6581 with -fselective-scheduling2 and custom flags zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2011-10-18 12:46 ` amonakov at gcc dot gnu.org
@ 2011-10-26 17:48 ` jakub at gcc dot gnu.org
  2011-10-27 10:15 ` [Bug rtl-optimization/50205] [4.6 " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-10-26 17:48 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50205

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.6.2                       |4.6.3

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-10-26 17:13:54 UTC ---
GCC 4.6.2 is being released.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug rtl-optimization/50205] [4.6 Regression] ICE: in code_motion_path_driver, at sel-sched.c:6581 with -fselective-scheduling2 and custom flags
  2011-08-27  2:39 [Bug rtl-optimization/50205] New: [4.6/4.7 Regression] ICE: in code_motion_path_driver, at sel-sched.c:6581 with -fselective-scheduling2 and custom flags zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2011-10-26 17:48 ` jakub at gcc dot gnu.org
@ 2011-10-27 10:15 ` rguenth at gcc dot gnu.org
  2012-03-01 15:30 ` jakub at gcc dot gnu.org
  2013-04-12 16:18 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-10-27 10:15 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50205

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
            Summary|[4.6/4.7 Regression] ICE:   |[4.6 Regression] ICE: in
                   |in code_motion_path_driver, |code_motion_path_driver, at
                   |at sel-sched.c:6581 with    |sel-sched.c:6581 with
                   |-fselective-scheduling2 and |-fselective-scheduling2 and
                   |custom flags                |custom flags


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug rtl-optimization/50205] [4.6 Regression] ICE: in code_motion_path_driver, at sel-sched.c:6581 with -fselective-scheduling2 and custom flags
  2011-08-27  2:39 [Bug rtl-optimization/50205] New: [4.6/4.7 Regression] ICE: in code_motion_path_driver, at sel-sched.c:6581 with -fselective-scheduling2 and custom flags zsojka at seznam dot cz
                   ` (6 preceding siblings ...)
  2011-10-27 10:15 ` [Bug rtl-optimization/50205] [4.6 " rguenth at gcc dot gnu.org
@ 2012-03-01 15:30 ` jakub at gcc dot gnu.org
  2013-04-12 16:18 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-03-01 15:30 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50205

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.6.3                       |4.6.4

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-03-01 14:39:13 UTC ---
GCC 4.6.3 is being released.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug rtl-optimization/50205] [4.6 Regression] ICE: in code_motion_path_driver, at sel-sched.c:6581 with -fselective-scheduling2 and custom flags
  2011-08-27  2:39 [Bug rtl-optimization/50205] New: [4.6/4.7 Regression] ICE: in code_motion_path_driver, at sel-sched.c:6581 with -fselective-scheduling2 and custom flags zsojka at seznam dot cz
                   ` (7 preceding siblings ...)
  2012-03-01 15:30 ` jakub at gcc dot gnu.org
@ 2013-04-12 16:18 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-04-12 16:18 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50205

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|4.6.4                       |4.7.0

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-04-12 16:17:58 UTC ---
The 4.6 branch has been closed, fixed in GCC 4.7.0.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-04-12 16:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-27  2:39 [Bug rtl-optimization/50205] New: [4.6/4.7 Regression] ICE: in code_motion_path_driver, at sel-sched.c:6581 with -fselective-scheduling2 and custom flags zsojka at seznam dot cz
2011-08-27  8:11 ` [Bug rtl-optimization/50205] " rguenth at gcc dot gnu.org
2011-09-06 11:18 ` amonakov at gcc dot gnu.org
2011-10-10 12:29 ` rguenth at gcc dot gnu.org
2011-10-18 12:36 ` amonakov at gcc dot gnu.org
2011-10-18 12:46 ` amonakov at gcc dot gnu.org
2011-10-26 17:48 ` jakub at gcc dot gnu.org
2011-10-27 10:15 ` [Bug rtl-optimization/50205] [4.6 " rguenth at gcc dot gnu.org
2012-03-01 15:30 ` jakub at gcc dot gnu.org
2013-04-12 16:18 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).