public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/11555] New: ICE in verify_loop_structure, at cfgloop.c:1270
@ 2003-07-17  0:25 v dot haisman at sh dot cvut dot cz
  2003-07-17  0:26 ` [Bug c/11555] " v dot haisman at sh dot cvut dot cz
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: v dot haisman at sh dot cvut dot cz @ 2003-07-17  0:25 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: ICE in verify_loop_structure, at cfgloop.c:1270
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: v dot haisman at sh dot cvut dot cz
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-cygwin
  GCC host triplet: i686-pc-cygwin
GCC target triplet: i686-pc-cygwin

This code fails to compile with -O{1,2} -ftracer -funroll-loops options. When
-O{0,3} is used or either -ftracer or -funroll-loops option is removed it
compiles. Testcase has been derived from gas/expr.c.

$ gcc -v
Reading specs from /usr/local/lib/gcc-lib/i686-pc-cygwin/3.3.1/specs
Configured with: ../srcdir/configure --srcdir=/cygdrive/c/WilX/gcc33/srcdir --en
able-threads=posix --enable-languages=c,c++ --enable-nls --without-included-gett
ext --enable-version-specific-runtime-libs --enable-dwarf2 --with-arch=atholn --
with-cpu=athlon
Thread model: posix
gcc version 3.3.1 20030716 (prerelease)

$ gcc-34 -O1 -ftracer -funroll-loops -c testcase2.c
testcase2.c: In function `mri_char_constant':
testcase2.c:20: error: Edge from 16 to 8 should not be marked irreducible.
testcase2.c:20: error: Edge from 50 to 8 should not be marked irreducible.
testcase2.c:20: internal compiler error: in verify_loop_structure, at cfgloop.c:
1270
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.


----8<-----
extern char *input_line_pointer;

static void mri_char_constant (void)
{
  int i;

  for (i = (20) - 1; i >= 0; i--)
    {
      int j;

      for (j = 0; j < (1 << (1)); j++)
	{
	  if (*input_line_pointer == '\'')
	    {
	      if (input_line_pointer[1] != '\'')
		break;
	    }
	}
    }
}


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

* [Bug c/11555] ICE in verify_loop_structure, at cfgloop.c:1270
  2003-07-17  0:25 [Bug c/11555] New: ICE in verify_loop_structure, at cfgloop.c:1270 v dot haisman at sh dot cvut dot cz
@ 2003-07-17  0:26 ` v dot haisman at sh dot cvut dot cz
  2003-07-17  0:35 ` [Bug optimization/11555] [3.4 Regression] " pinskia at physics dot uc dot edu
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: v dot haisman at sh dot cvut dot cz @ 2003-07-17  0:26 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


v dot haisman at sh dot cvut dot cz changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |v dot haisman at sh dot cvut
                   |                            |dot cz


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

* [Bug optimization/11555] [3.4 Regression] ICE in verify_loop_structure, at cfgloop.c:1270
  2003-07-17  0:25 [Bug c/11555] New: ICE in verify_loop_structure, at cfgloop.c:1270 v dot haisman at sh dot cvut dot cz
  2003-07-17  0:26 ` [Bug c/11555] " v dot haisman at sh dot cvut dot cz
@ 2003-07-17  0:35 ` pinskia at physics dot uc dot edu
  2003-07-23 23:39 ` janis187 at us dot ibm dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-17  0:35 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical
             Status|UNCONFIRMED                 |NEW
          Component|c                           |optimization
     Ever Confirmed|                            |1
 GCC target triplet|i686-pc-cygwin              |i686-*-*
           Keywords|                            |ice-on-valid-code
           Priority|P3                          |P1
   Last reconfirmed|0000-00-00 00:00:00         |2003-07-17 00:35:16
               date|                            |
            Summary|ICE in                      |[3.4 Regression] ICE in
                   |verify_loop_structure, at   |verify_loop_structure, at
                   |cfgloop.c:1270              |cfgloop.c:1270


------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-17 00:35 -------
I can confirm this on the mainline (20030716). On 3.3.1 (20030707), gcc does not ICE so this is a 
regression.


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

* [Bug optimization/11555] [3.4 Regression] ICE in verify_loop_structure, at cfgloop.c:1270
  2003-07-17  0:25 [Bug c/11555] New: ICE in verify_loop_structure, at cfgloop.c:1270 v dot haisman at sh dot cvut dot cz
  2003-07-17  0:26 ` [Bug c/11555] " v dot haisman at sh dot cvut dot cz
  2003-07-17  0:35 ` [Bug optimization/11555] [3.4 Regression] " pinskia at physics dot uc dot edu
@ 2003-07-23 23:39 ` janis187 at us dot ibm dot com
  2003-07-24 18:55 ` rakdver at atrey dot karlin dot mff dot cuni dot cz
  2003-07-24 19:21 ` pinskia at physics dot uc dot edu
  4 siblings, 0 replies; 6+ messages in thread
From: janis187 at us dot ibm dot com @ 2003-07-23 23:39 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


janis187 at us dot ibm dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rakdver at atrey dot karlin
                   |                            |dot mff dot cuni dot cz


------- Additional Comments From janis187 at us dot ibm dot com  2003-07-23 23:39 -------
The regression in PR 11555 was introduced or exposed by this patch:

--- gcc/gcc/ChangeLog ---

2003-07-03  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>

        * cfglayout.c (cfg_layout_duplicate_bb): Do not update frequencies
        at all if edge is not specified.
        (can_copy_bbs_p, copy_bbs): New.
        * cfglayout.h (can_copy_bbs_p, copy_bbs): Declare.
        * cfgloop.c (get_loop_body): Comment more precisely.
        * cfgloopmanip.c (copy_bbs, record_exit_edges): Removed.
        (scale_bbs_frequencies): Fix comment typo.
        (can_duplicate_loop_p): Use can_copy_bbs_p.
        (duplicate_loop_to_header_edge): Simplify by using copy_bbs.

The regression hunt used the submitter's test case on i686-pc-linux-gnu
(note that currently the target is listed as i686-pc-cygwin) and the
options "-O1 -ftracer -funroll-loops".


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

* [Bug optimization/11555] [3.4 Regression] ICE in verify_loop_structure, at cfgloop.c:1270
  2003-07-17  0:25 [Bug c/11555] New: ICE in verify_loop_structure, at cfgloop.c:1270 v dot haisman at sh dot cvut dot cz
                   ` (2 preceding siblings ...)
  2003-07-23 23:39 ` janis187 at us dot ibm dot com
@ 2003-07-24 18:55 ` rakdver at atrey dot karlin dot mff dot cuni dot cz
  2003-07-24 19:21 ` pinskia at physics dot uc dot edu
  4 siblings, 0 replies; 6+ messages in thread
From: rakdver at atrey dot karlin dot mff dot cuni dot cz @ 2003-07-24 18:55 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From rakdver at atrey dot karlin dot mff dot cuni dot cz  2003-07-24 18:55 -------
Subject: Re:  [3.4 Regression] ICE in verify_loop_structure, at cfgloop.c:1270

Hello,

I was mistakenly adding irreducible flag to all  edges instead
only to those in copied region.  I am commiting the following fix as
obvious.

Zdenek

	* cfgloopmanip.c (duplicate_loop_to_header_edge): Update irreducible
	flag correctly.

Index: cfgloopmanip.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgloopmanip.c,v
retrieving revision 1.14
diff -c -3 -p -r1.14 cfgloopmanip.c
*** cfgloopmanip.c	5 Jul 2003 15:17:26 -0000	1.14
--- cfgloopmanip.c	24 Jul 2003 18:45:05 -0000
*************** duplicate_loop_to_header_edge (struct lo
*** 988,993 ****
--- 988,1014 ----
        /* Copy bbs.  */
        copy_bbs (bbs, n, new_bbs, spec_edges, 2, new_spec_edges, loop, loops);
  
+       /* Note whether the blocks and edges belong to an irreducible loop.  */
+       if (add_irreducible_flag)
+ 	{
+ 	  for (i = 0; i < n; i++)
+ 	    new_bbs[i]->rbi->duplicated = 1;
+ 	  for (i = 0; i < n; i++)
+ 	    {
+ 	      new_bb = new_bbs[i];
+ 	      if (new_bb->loop_father == target)
+ 		new_bb->flags |= BB_IRREDUCIBLE_LOOP;
+ 
+ 	      for (ae = new_bb->succ; ae; ae = ae->succ_next)
+ 		if (ae->dest->rbi->duplicated
+ 		    && (ae->src->loop_father == target
+ 			|| ae->dest->loop_father == target))
+ 		  ae->flags |= EDGE_IRREDUCIBLE_LOOP;
+ 	    }
+ 	  for (i = 0; i < n; i++)
+ 	    new_bbs[i]->rbi->duplicated = 0;
+ 	}
+ 
        /* Redirect the special edges.  */
        if (is_latch)
  	{
*************** duplicate_loop_to_header_edge (struct lo
*** 1010,1031 ****
        /* Record exit edge in this copy.  */
        if (orig && TEST_BIT (wont_exit, j + 1))
  	to_remove[(*n_to_remove)++] = new_spec_edges[SE_ORIG];
- 
-       /* Note whether the blocks and edges belong to an irreducible loop.  */
-       if (add_irreducible_flag)
- 	{
- 	  for (i = 0; i < n; i++)
- 	    {
- 	      new_bb = new_bbs[i];
- 	      if (new_bb->loop_father == target)
- 		new_bb->flags |= BB_IRREDUCIBLE_LOOP;
- 
- 	      for (ae = new_bb->succ; ae; ae = ae->succ_next)
- 		if (ae->src->loop_father == target
- 		    || ae->dest->loop_father == target)
- 		  ae->flags |= EDGE_IRREDUCIBLE_LOOP;
- 	    }
- 	}
  
        /* Record the first copy in the control flow order if it is not
  	 the original loop (i.e. in case of peeling).  */
--- 1031,1036 ----


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

* [Bug optimization/11555] [3.4 Regression] ICE in verify_loop_structure, at cfgloop.c:1270
  2003-07-17  0:25 [Bug c/11555] New: ICE in verify_loop_structure, at cfgloop.c:1270 v dot haisman at sh dot cvut dot cz
                   ` (3 preceding siblings ...)
  2003-07-24 18:55 ` rakdver at atrey dot karlin dot mff dot cuni dot cz
@ 2003-07-24 19:21 ` pinskia at physics dot uc dot edu
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-24 19:21 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-24 19:21 -------
Fixed by the above patch.


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

end of thread, other threads:[~2003-07-24 19:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-17  0:25 [Bug c/11555] New: ICE in verify_loop_structure, at cfgloop.c:1270 v dot haisman at sh dot cvut dot cz
2003-07-17  0:26 ` [Bug c/11555] " v dot haisman at sh dot cvut dot cz
2003-07-17  0:35 ` [Bug optimization/11555] [3.4 Regression] " pinskia at physics dot uc dot edu
2003-07-23 23:39 ` janis187 at us dot ibm dot com
2003-07-24 18:55 ` rakdver at atrey dot karlin dot mff dot cuni dot cz
2003-07-24 19:21 ` pinskia at physics dot uc dot edu

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).