public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/24262]  New: ICE: verify_ssa failed with -O -msse2 -ftree-vectorize
@ 2005-10-07 18:52 ferdinandw+gcc at gmail dot com
  2005-10-07 19:27 ` [Bug tree-optimization/24262] [4.1 Regression] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: ferdinandw+gcc at gmail dot com @ 2005-10-07 18:52 UTC (permalink / raw)
  To: gcc-bugs

/tmp/gcc41/libexec/gcc/i686-pc-linux-gnu/4.1.0/cc1 -quiet -v test.c -dumpbase
test.c -msse2 -auxbase-strip test.o -O -version -ftree-vectorize -o test.o

GNU C version 4.1.0 20051007 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 4.1.0 20051007 (experimental).
GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129306
Compiler executable checksum: a278381769db4d67bad1ec630ceb45dd
test.c: In function 'test':
test.c:4: error: definition in block 1 does not dominate use in block 0
for SSA_NAME: D.1603_5 in statement:
base_off.27_12 = D.1603_5 * 16;
test.c:4: internal compiler error: verify_ssa failed

Configured with: ../gcc/configure --prefix=/tmp/gcc41 --enable-languages=c
--disable-nls --enable-checking=assert,rtlflag,misc

========================================================

void dSetZero (double *a);

void test()
{
  double A[12];
  int i;

  dSetZero (A);
  for (i=0; i<6; i++) A[i+2*(i/2)] = 4;
  dSetZero (A);

}

========================================================


-- 
           Summary: ICE: verify_ssa failed with -O -msse2 -ftree-vectorize
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ferdinandw+gcc at gmail dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug tree-optimization/24262] [4.1 Regression] ICE: verify_ssa failed with -O -msse2 -ftree-vectorize
  2005-10-07 18:52 [Bug tree-optimization/24262] New: ICE: verify_ssa failed with -O -msse2 -ftree-vectorize ferdinandw+gcc at gmail dot com
@ 2005-10-07 19:27 ` pinskia at gcc dot gnu dot org
  2005-10-12  7:23 ` dorit at il dot ibm dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-07 19:27 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1231 bytes --]



------- Comment #1 from pinskia at gcc dot gnu dot org  2005-10-07 19:27 -------
Confirmed, this was always broken in that we got wrong code in 4.0.0 but now we
get an ICE which means this is a regression and a progression.

Adding -W -Wall for 4.0, you get a warning:
t.c: In function ‘test’:
t.c:9: warning: ‘({anonymous})’ is used uninitialized in this function


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-valid-code, wrong-
                   |                            |code
   Last reconfirmed|0000-00-00 00:00:00         |2005-10-07 19:27:42
               date|                            |
            Summary|ICE: verify_ssa failed with |[4.1 Regression] ICE:
                   |-O -msse2 -ftree-vectorize  |verify_ssa failed with -O -
                   |                            |msse2 -ftree-vectorize
   Target Milestone|---                         |4.1.0


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


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

* [Bug tree-optimization/24262] [4.1 Regression] ICE: verify_ssa failed with -O -msse2 -ftree-vectorize
  2005-10-07 18:52 [Bug tree-optimization/24262] New: ICE: verify_ssa failed with -O -msse2 -ftree-vectorize ferdinandw+gcc at gmail dot com
  2005-10-07 19:27 ` [Bug tree-optimization/24262] [4.1 Regression] " pinskia at gcc dot gnu dot org
@ 2005-10-12  7:23 ` dorit at il dot ibm dot com
  2005-10-12  9:00 ` irar at il dot ibm dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dorit at il dot ibm dot com @ 2005-10-12  7:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from dorit at il dot ibm dot com  2005-10-12 07:23 -------
There are two problems here:

1) This is the data-reference structure created (using the same testcase but
with floats instead of doubles):
        Created dr for A[D.1705_7]
          base_address: &A
          offset from base address: (<unnamed type>) (D.1703_5 * 8)
          constant offset from base address: 0
          base_object: A
          step: 4B
          misalignment from base:
          memtag: A
We then use the information in the fields above to calculate the first address
accessed, as follows:
        base_off.31_18 = D.1703_5 * 8;
        vect_pA.32_19 = &A + base_off.31_18;
but the problem is that we can't use the expression "D.1703_5 * 8" from field
"offset from base address" as is, because D.1703_5 depends on other
computations that should take place first. I think we had this problem in the
past but it had been solved. I wonder why it reappeared - maybe this is related
to the second problem:

2) This loop shouldn't be vectorized in the first place, because the vectorizer
can currently handle only consecutive accesses, but this loop accesses
locations {0,1,4,5,8,9}. For some reason (scalar evolution bug? dataref
analysis bug?) we conclude that the step of the access is simply 4B (i.e.
consecutive accesses).
(Indeed for doubles, pairs of iterations can be vectorized ({0,1} {4,5} and
{8,9}) with a proper stride between the vectorized iterations, but the
vectorizer can't do something like that now).


-- 


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


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

* [Bug tree-optimization/24262] [4.1 Regression] ICE: verify_ssa failed with -O -msse2 -ftree-vectorize
  2005-10-07 18:52 [Bug tree-optimization/24262] New: ICE: verify_ssa failed with -O -msse2 -ftree-vectorize ferdinandw+gcc at gmail dot com
  2005-10-07 19:27 ` [Bug tree-optimization/24262] [4.1 Regression] " pinskia at gcc dot gnu dot org
  2005-10-12  7:23 ` dorit at il dot ibm dot com
@ 2005-10-12  9:00 ` irar at il dot ibm dot com
  2005-10-12 16:26 ` sebastian dot pop at cri dot ensmp dot fr
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: irar at il dot ibm dot com @ 2005-10-12  9:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from irar at il dot ibm dot com  2005-10-12 09:00 -------
I think, it's the same bug in scev that my autovect patch
http://gcc.gnu.org/ml/gcc-patches/2005-07/msg00252.html solved (and Sebastian
reverted it).

Here scev analyzer calculates the evolution of 'D.1703_5 * 2 + i_15',
where 'D.1703_5 = i_15/2'.  Scev doesn't handle division, therefore 
for D.1703_5 we get unknown scev, but then it's combined with the 
rest of the expression, erroneously leading to {D.1703_5*2, +, 1}.

Ira



-- 

irar at il dot ibm dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2005-10-07 19:27:42         |2005-10-12 09:00:12
               date|                            |


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


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

* [Bug tree-optimization/24262] [4.1 Regression] ICE: verify_ssa failed with -O -msse2 -ftree-vectorize
  2005-10-07 18:52 [Bug tree-optimization/24262] New: ICE: verify_ssa failed with -O -msse2 -ftree-vectorize ferdinandw+gcc at gmail dot com
                   ` (2 preceding siblings ...)
  2005-10-12  9:00 ` irar at il dot ibm dot com
@ 2005-10-12 16:26 ` sebastian dot pop at cri dot ensmp dot fr
  2005-10-12 16:53 ` sebastian dot pop at cri dot ensmp dot fr
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: sebastian dot pop at cri dot ensmp dot fr @ 2005-10-12 16:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from sebastian dot pop at cri dot ensmp dot fr  2005-10-12 16:26 -------
Subject: Re:  [4.1 Regression] ICE: verify_ssa failed with -O -msse2
-ftree-vectorize

irar at il dot ibm dot com wrote:
> Here scev analyzer calculates the evolution of 'D.1703_5 * 2 + i_15',
> where 'D.1703_5 = i_15/2'.  Scev doesn't handle division, therefore 
> for D.1703_5 we get unknown scev, but then it's combined with the 
> rest of the expression, erroneously leading to {D.1703_5*2, +, 1}.
> 

I don't follow: "unknown + something" should be folded into "unknown",
not {D.1703_5*2, +, 1}_x: if D.1703_5 is defined in loop_x, it
potentially has an evolution in loop_x.  I'm thinking that a test:

if (!expr_invariant_in_loop_p (loop, CHREC_LEFT (chrec)))
  then give up with this case,

would solve this bug.


-- 


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


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

* [Bug tree-optimization/24262] [4.1 Regression] ICE: verify_ssa failed with -O -msse2 -ftree-vectorize
  2005-10-07 18:52 [Bug tree-optimization/24262] New: ICE: verify_ssa failed with -O -msse2 -ftree-vectorize ferdinandw+gcc at gmail dot com
                   ` (3 preceding siblings ...)
  2005-10-12 16:26 ` sebastian dot pop at cri dot ensmp dot fr
@ 2005-10-12 16:53 ` sebastian dot pop at cri dot ensmp dot fr
  2005-10-13 11:53 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: sebastian dot pop at cri dot ensmp dot fr @ 2005-10-12 16:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from sebastian dot pop at cri dot ensmp dot fr  2005-10-12 16:53 -------
Subject: Re:  [4.1 Regression] ICE: verify_ssa failed with -O -msse2
-ftree-vectorize

Sebastian Pop wrote:
> 
> if (!expr_invariant_in_loop_p (loop, CHREC_LEFT (chrec)))
>   then give up with this case,
> 
> would solve this bug.

We already do this! By the way, why do we need the "init == expr"
check?  The following (not tested yet) patch solves this bug.  Anybody
remembers about why we have the extra check?

*** tree-data-ref.c.~2.44.~     2005-09-24 21:12:03.000000000 +0200
--- tree-data-ref.c     2005-10-12 18:54:38.000000000 +0200
***************
*** 1124,1130 ****
        return false;

        init = initial_condition_in_loop_num (access_fn, loop->num);
!       if (init == expr && !expr_invariant_in_loop_p (loop, init))
        /* Not enough information: may be not loop invariant.  
           E.g., for a[b[i]], we get a[D], where D=b[i]. EXPR is D, its 
           initial_condition is D, but it depends on i - loop's induction
--- 1124,1130 ----
        return false;

        init = initial_condition_in_loop_num (access_fn, loop->num);
!       if (!expr_invariant_in_loop_p (loop, init))
        /* Not enough information: may be not loop invariant.  
           E.g., for a[b[i]], we get a[D], where D=b[i]. EXPR is D, its 
           initial_condition is D, but it depends on i - loop's induction


-- 


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


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

* [Bug tree-optimization/24262] [4.1 Regression] ICE: verify_ssa failed with -O -msse2 -ftree-vectorize
  2005-10-07 18:52 [Bug tree-optimization/24262] New: ICE: verify_ssa failed with -O -msse2 -ftree-vectorize ferdinandw+gcc at gmail dot com
                   ` (4 preceding siblings ...)
  2005-10-12 16:53 ` sebastian dot pop at cri dot ensmp dot fr
@ 2005-10-13 11:53 ` cvs-commit at gcc dot gnu dot org
  2005-10-13 13:46 ` pinskia at gcc dot gnu dot org
  2005-10-24  9:38 ` irar at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-10-13 11:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from cvs-commit at gcc dot gnu dot org  2005-10-13 11:53 -------
Subject: Bug 24262

CVSROOT:        /cvs/gcc
Module name:    gcc
Changes by:     spop@gcc.gnu.org        2005-10-13 11:52:58

Modified files:
        gcc            : ChangeLog tree-data-ref.c 

Log message:
        PR tree-optimization/24262
        * tree-data-ref.c (analyze_offset_expr): Check that init is invariant
        in loop all the time.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.10152&r2=2.10153
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-data-ref.c.diff?cvsroot=gcc&r1=2.44&r2=2.45


-- 


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


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

* [Bug tree-optimization/24262] [4.1 Regression] ICE: verify_ssa failed with -O -msse2 -ftree-vectorize
  2005-10-07 18:52 [Bug tree-optimization/24262] New: ICE: verify_ssa failed with -O -msse2 -ftree-vectorize ferdinandw+gcc at gmail dot com
                   ` (5 preceding siblings ...)
  2005-10-13 11:53 ` cvs-commit at gcc dot gnu dot org
@ 2005-10-13 13:46 ` pinskia at gcc dot gnu dot org
  2005-10-24  9:38 ` irar at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-13 13:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2005-10-13 13:46 -------
Fixed.


-- 

pinskia at gcc dot gnu dot org changed:

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


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


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

* [Bug tree-optimization/24262] [4.1 Regression] ICE: verify_ssa failed with -O -msse2 -ftree-vectorize
  2005-10-07 18:52 [Bug tree-optimization/24262] New: ICE: verify_ssa failed with -O -msse2 -ftree-vectorize ferdinandw+gcc at gmail dot com
                   ` (6 preceding siblings ...)
  2005-10-13 13:46 ` pinskia at gcc dot gnu dot org
@ 2005-10-24  9:38 ` irar at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: irar at gcc dot gnu dot org @ 2005-10-24  9:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from irar at gcc dot gnu dot org  2005-10-24 09:38 -------
Subject: Bug 24262

Author: irar
Date: Mon Oct 24 09:38:20 2005
New Revision: 105376

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=105376
Log:
        Bring over from mainline:

        2005-10-12  Sebastian Pop  <pop@cri.ensmp.fr>

        PR tree-optimization/24262
        * tree-data-ref.c (analyze_offset_expr): Check that init is invariant
        in loop all the time.


Modified:
    branches/autovect-branch/gcc/ChangeLog.autovect
    branches/autovect-branch/gcc/tree-data-ref.c


-- 


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


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

end of thread, other threads:[~2005-10-24  9:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-07 18:52 [Bug tree-optimization/24262] New: ICE: verify_ssa failed with -O -msse2 -ftree-vectorize ferdinandw+gcc at gmail dot com
2005-10-07 19:27 ` [Bug tree-optimization/24262] [4.1 Regression] " pinskia at gcc dot gnu dot org
2005-10-12  7:23 ` dorit at il dot ibm dot com
2005-10-12  9:00 ` irar at il dot ibm dot com
2005-10-12 16:26 ` sebastian dot pop at cri dot ensmp dot fr
2005-10-12 16:53 ` sebastian dot pop at cri dot ensmp dot fr
2005-10-13 11:53 ` cvs-commit at gcc dot gnu dot org
2005-10-13 13:46 ` pinskia at gcc dot gnu dot org
2005-10-24  9:38 ` irar at gcc dot gnu dot 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).