Bug 22088 - [4.1 regression] ICE with -ftree-vectorize
Summary: [4.1 regression] ICE with -ftree-vectorize
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: 4.1.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code, monitored
Depends on:
Blocks:
 
Reported: 2005-06-16 08:24 UTC by Volker Reichelt
Modified: 2005-06-17 22:11 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.0.0 4.0.1
Known to fail: 4.1.0
Last reconfirmed: 2005-06-17 10:07:46


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2005-06-16 08:25:00 UTC
The following testcase causes an ICE on i686-pc-linux-gnu when compiled with
"-O -march=pentium4 -ftree-vectorize":

===============================
double d[3];

void foo() 
{ 
    int i;
    for (i=0; i<3; ++i)
        d[i] = 0;
}
===============================

bug.c: In function 'foo':
bug.c:4: internal compiler error: in get_bb_copy, at cfg.c:1078
Please submit a full bug report, [etc.]

The regression was introduced yesterday (2005-06-15).
Comment 1 Volker Reichelt 2005-06-16 08:32:26 UTC
Honza, this was introduced with your patch
http://gcc.gnu.org/ml/gcc-cvs/2005-06/msg00584.html

Could you please have a look?
Comment 2 Jan Hubicka 2005-06-16 08:36:31 UTC
Subject: Re:  [4.1 regression] ICE with -ftree-vectorize

> 
> ------- Additional Comments From reichelt at gcc dot gnu dot org  2005-06-16 08:32 -------
> Honza, this was introduced with your patch
> http://gcc.gnu.org/ml/gcc-cvs/2005-06/msg00584.html
> 
> Could you please have a look?

Looks like initialization/finalization of original/copy tables is
missing somewhere.  I will check.

Honza
> 
> 
> -- 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |hubicka at gcc dot gnu dot
>                    |                            |org
> 
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22088
> 
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.
Comment 3 Dorit Naishlos 2005-06-17 12:58:34 UTC
> bug.c: In function 'foo':
> bug.c:4: internal compiler error: in get_bb_copy, at cfg.c:1078

a bunch of vectorizer testcases are failing with this error on 
i686-pc-linux-gnu and powerpc-darwin
Comment 4 Jan Hubicka 2005-06-17 13:53:23 UTC
Subject: Re:  [4.1 regression] ICE with -ftree-vectorize

> 
> ------- Additional Comments From dorit at il dot ibm dot com  2005-06-17 12:58 -------
> > bug.c: In function 'foo':
> > bug.c:4: internal compiler error: in get_bb_copy, at cfg.c:1078
> 
> a bunch of vectorizer testcases are failing with this error on 
> i686-pc-linux-gnu and powerpc-darwin

THe attached patch should fix it.  I wonder why it didn't show up in my
i686 regtest originally?  (are the vectorizer testcases disabled by
default or something?)


Index: tree-vect-transform.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-vect-transform.c,v
retrieving revision 2.25
diff -c -3 -p -r2.25 tree-vect-transform.c
*** tree-vect-transform.c	10 Jun 2005 14:51:44 -0000	2.25
--- tree-vect-transform.c	17 Jun 2005 13:13:52 -0000
*************** vect_transform_loop (loop_vec_info loop_
*** 2048,2053 ****
--- 2048,2054 ----
    if (vect_print_dump_info (REPORT_DETAILS, UNKNOWN_LOC))
      fprintf (vect_dump, "=== vec_transform_loop ===");
  
+   initialize_original_copy_tables ();
    
    /* Peel the loop if there are data refs with unknown alignment.
       Only one data ref with unknown store is allowed.  */
*************** vect_transform_loop (loop_vec_info loop_
*** 2139,2144 ****
--- 2140,2147 ----
       until all the loops have been transformed?  */
    update_ssa (TODO_update_ssa);
  
+   free_original_copy_tables ();
+ 
    if (vect_print_dump_info (REPORT_VECTORIZED_LOOPS, LOOP_LOC (loop_vinfo)))
      fprintf (vect_dump, "LOOP VECTORIZED.");
  }
Comment 5 Richard Henderson 2005-06-17 22:11:55 UTC
Fixed: http://gcc.gnu.org/ml/gcc-patches/2005-06/msg01535.html

Although I didn't see this pr before writing the patch, I like my patch
better because not all paths go through loop peeling.  Which means that
we'd do the init/free in cases that don't need it.

No, the vectorization tests are never disabled.  We *always* at least do
the compile tests.
Comment 6 Jan Hubicka 2005-06-17 23:31:47 UTC
Subject: Re:  [4.1 regression] ICE with -ftree-vectorize

> 
> ------- Additional Comments From rth at gcc dot gnu dot org  2005-06-17 22:11 -------
> Fixed: http://gcc.gnu.org/ml/gcc-patches/2005-06/msg01535.html
> 
> Although I didn't see this pr before writing the patch, I like my patch
> better because not all paths go through loop peeling.  Which means that
> we'd do the init/free in cases that don't need it.

Ah, thanks for fixing that!  I just sent patch for that too, but too
late..
> 
> No, the vectorization tests are never disabled.  We *always* at least do
> the compile tests.

Weird, my scripts must have some kind of leak then.  I have to dig into
logs...

Honza
> 
> -- 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|NEW                         |RESOLVED
>          Resolution|                            |FIXED
> 
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22088