public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/30858] ice for legal code with -O2 -ftree-vectorize
  2007-02-19 11:59 [Bug c/30858] New: ice for legal code with -O2 -ftree-vectorize dcb314 at hotmail dot com
@ 2007-02-19 11:59 ` dcb314 at hotmail dot com
  2007-02-19 12:45 ` dorit at il dot ibm dot com
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dcb314 at hotmail dot com @ 2007-02-19 11:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from dcb314 at hotmail dot com  2007-02-19 11:59 -------
Created an attachment (id=13069)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13069&action=view)
C source code


-- 


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


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

* [Bug c/30858]  New: ice for legal code with -O2 -ftree-vectorize
@ 2007-02-19 11:59 dcb314 at hotmail dot com
  2007-02-19 11:59 ` [Bug c/30858] " dcb314 at hotmail dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: dcb314 at hotmail dot com @ 2007-02-19 11:59 UTC (permalink / raw)
  To: gcc-bugs

I just tried to compile Suse Linux package timidity-2.13.2-60
with the GNU C++ compiler version 4.3 snapshot 20070216.

The compiler said

ncurs_c.c:1196: internal compiler error: in get_initial_def_for_reduction, at
tree-vect-transform.c:1036
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

Preprocessed source code attached. Flags -O2 -ftree-vectorize required.

On the wider issue of the quality of the vectorizer, I
have thrown most of Suse Linux 10.3 at it and it has crashed
in a few places.

I suspect there would be considerable value at getting some
other distribution [ Debian ?], maybe on another type of 
machine [ PPC64 ?], and flushing out a few more bugs in the optimizer.

You would need to ensure that -ftree-vectorize was switched
on for every compile.

Just a suggestion.


-- 
           Summary: ice for legal code with -O2 -ftree-vectorize
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dcb314 at hotmail dot com
  GCC host triplet: x86_64-suse-linux


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


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

* [Bug c/30858] ice for legal code with -O2 -ftree-vectorize
  2007-02-19 11:59 [Bug c/30858] New: ice for legal code with -O2 -ftree-vectorize dcb314 at hotmail dot com
  2007-02-19 11:59 ` [Bug c/30858] " dcb314 at hotmail dot com
@ 2007-02-19 12:45 ` dorit at il dot ibm dot com
  2007-02-19 12:56 ` dorit at il dot ibm dot com
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dorit at il dot ibm dot com @ 2007-02-19 12:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from dorit at il dot ibm dot com  2007-02-19 12:45 -------
Reduced testcase:

int foo (int ko)
{
 int j,i;
  for (j = 0; j < ko; j++)
   i += (i > 10) ? -5 : 7;
 return i;
}

Looking into it...


-- 

dorit at il dot ibm dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ice for legal code with -O2 |ice for legal code with -O2
                   |-ftree-vectorize            |-ftree-vectorize


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


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

* [Bug c/30858] ice for legal code with -O2 -ftree-vectorize
  2007-02-19 11:59 [Bug c/30858] New: ice for legal code with -O2 -ftree-vectorize dcb314 at hotmail dot com
  2007-02-19 11:59 ` [Bug c/30858] " dcb314 at hotmail dot com
  2007-02-19 12:45 ` dorit at il dot ibm dot com
@ 2007-02-19 12:56 ` dorit at il dot ibm dot com
  2007-02-19 13:17 ` [Bug tree-optimization/30858] [4.3 Regression] " rguenth at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dorit at il dot ibm dot com @ 2007-02-19 12:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dorit at il dot ibm dot com  2007-02-19 12:56 -------
(In reply to comment #0)

Thanks for exercising the vectorizer and reporting these bugs!

> On the wider issue of the quality of the vectorizer, I
> have thrown most of Suse Linux 10.3 at it and it has crashed
> in a few places.

only a few? :-)

> I suspect there would be considerable value at getting some
> other distribution [ Debian ?], maybe on another type of 
> machine [ PPC64 ?], and flushing out a few more bugs in the optimizer.
> You would need to ensure that -ftree-vectorize was switched
> on for every compile.
> Just a suggestion.

I agree. We are working on a cost model these days to make the vectorizer less
greedy, hopefully as a step towards enabling vectorization on by default -
which would help in flushing bugs out.

(Just as a side comment - FYI - most of the vectorizer bugs you opened so far
in the last few days (30771, 30795, 30843) are related to features that were
added *very* recently).


-- 


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


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

* [Bug tree-optimization/30858] [4.3 Regression] ice for legal code with -O2 -ftree-vectorize
  2007-02-19 11:59 [Bug c/30858] New: ice for legal code with -O2 -ftree-vectorize dcb314 at hotmail dot com
                   ` (2 preceding siblings ...)
  2007-02-19 12:56 ` dorit at il dot ibm dot com
@ 2007-02-19 13:17 ` rguenth at gcc dot gnu dot org
  2007-02-19 14:12 ` dorit at il dot ibm dot com
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-02-19 13:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2007-02-19 13:17 -------
Confirmed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|c                           |tree-optimization
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|0000-00-00 00:00:00         |2007-02-19 13:17:31
               date|                            |
            Summary|ice for legal code with -O2 |[4.3 Regression] ice for
                   |-ftree-vectorize            |legal code with -O2 -ftree-
                   |                            |vectorize
   Target Milestone|---                         |4.3.0


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


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

* [Bug tree-optimization/30858] [4.3 Regression] ice for legal code with -O2 -ftree-vectorize
  2007-02-19 11:59 [Bug c/30858] New: ice for legal code with -O2 -ftree-vectorize dcb314 at hotmail dot com
                   ` (3 preceding siblings ...)
  2007-02-19 13:17 ` [Bug tree-optimization/30858] [4.3 Regression] " rguenth at gcc dot gnu dot org
@ 2007-02-19 14:12 ` dorit at il dot ibm dot com
  2007-02-20 22:56 ` dorit at il dot ibm dot com
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dorit at il dot ibm dot com @ 2007-02-19 14:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from dorit at il dot ibm dot com  2007-02-19 14:12 -------
Looks like I wasn't careful enough with my fix for PR30771. Here is a fix for
that fix I'm now testing:

Index: tree-vect-analyze.c
===================================================================
--- tree-vect-analyze.c (revision 122128)
+++ tree-vect-analyze.c (working copy)
@@ -124,10 +124,11 @@

          /* Two cases of "relevant" phis: those that define an
             induction that is used in the loop, and those that
-            define a reduction.  */
+            directly define a reduction.  */
          if ((STMT_VINFO_RELEVANT (stmt_info) == vect_used_in_loop
               && STMT_VINFO_DEF_TYPE (stmt_info) == vect_induction_def)
-             || (STMT_VINFO_RELEVANT (stmt_info) == vect_used_by_reduction
+             || (STMT_VINFO_RELEVANT (stmt_info) ==
+                                          vect_used_directly_by_reduction
                  && STMT_VINFO_DEF_TYPE (stmt_info) == vect_reduction_def))
             {
              gcc_assert (!STMT_VINFO_VECTYPE (stmt_info));
@@ -328,8 +329,12 @@
            return false;
          }

-         if (STMT_VINFO_RELEVANT (stmt_info) == vect_used_in_loop
-             && STMT_VINFO_DEF_TYPE (stmt_info) != vect_induction_def)
+         if ((STMT_VINFO_RELEVANT (stmt_info) == vect_used_in_loop
+              && STMT_VINFO_DEF_TYPE (stmt_info) != vect_induction_def)
+             || (STMT_VINFO_RELEVANT (stmt_info) >
+                                           vect_used_directly_by_reduction
+                  && STMT_VINFO_DEF_TYPE (stmt_info) == vect_reduction_def))
+
            {
              /* Most likely a reduction-like computation that is used
                 in the loop.  */
@@ -2313,9 +2318,11 @@
       if (STMT_VINFO_DEF_TYPE (stmt_vinfo) == vect_reduction_def)
        {
          gcc_assert (relevant == vect_unused_in_loop && live_p);
-         relevant = vect_used_by_reduction;
+         relevant = vect_used_directly_by_reduction;
          live_p = false;
        }
+      else if (relevant == vect_used_directly_by_reduction)
+       relevant = vect_used_by_reduction;

       i = 0;
       FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter, SSA_OP_USE)
Index: tree-vectorizer.h
===================================================================
--- tree-vectorizer.h   (revision 122128)
+++ tree-vectorizer.h   (working copy)
@@ -175,6 +175,7 @@
 /* Indicates whether/how a variable is used in the loop.  */
 enum vect_relevant {
   vect_unused_in_loop = 0,
+  vect_used_directly_by_reduction,
   vect_used_by_reduction,
   vect_used_in_loop
 };


-- 


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


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

* [Bug tree-optimization/30858] [4.3 Regression] ice for legal code with -O2 -ftree-vectorize
  2007-02-19 11:59 [Bug c/30858] New: ice for legal code with -O2 -ftree-vectorize dcb314 at hotmail dot com
                   ` (4 preceding siblings ...)
  2007-02-19 14:12 ` dorit at il dot ibm dot com
@ 2007-02-20 22:56 ` dorit at il dot ibm dot com
  2007-02-21 12:17 ` dcb314 at hotmail dot com
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dorit at il dot ibm dot com @ 2007-02-20 22:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from dorit at il dot ibm dot com  2007-02-20 22:56 -------
proposed patches - http://gcc.gnu.org/ml/gcc-patches/2007-02/msg01734.html

> I have thrown most of Suse Linux 10.3 at it and it has crashed
> in a few places.

would you mind giving these patches a try? (to see what's the next ICE...?)


-- 


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


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

* [Bug tree-optimization/30858] [4.3 Regression] ice for legal code with -O2 -ftree-vectorize
  2007-02-19 11:59 [Bug c/30858] New: ice for legal code with -O2 -ftree-vectorize dcb314 at hotmail dot com
                   ` (5 preceding siblings ...)
  2007-02-20 22:56 ` dorit at il dot ibm dot com
@ 2007-02-21 12:17 ` dcb314 at hotmail dot com
  2007-02-21 19:31 ` dorit at il dot ibm dot com
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dcb314 at hotmail dot com @ 2007-02-21 12:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from dcb314 at hotmail dot com  2007-02-21 12:17 -------
(In reply to comment #6)
> proposed patches - http://gcc.gnu.org/ml/gcc-patches/2007-02/msg01734.html

> would you mind giving these patches a try? (to see what's the next ICE...?)

If the patches have been applied to gcc mainstream,
then they will appear in the next 4.3 snapshot, due 23 Feb,
and so I will test them then.

Is this acceptable ?


-- 


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


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

* [Bug tree-optimization/30858] [4.3 Regression] ice for legal code with -O2 -ftree-vectorize
  2007-02-19 11:59 [Bug c/30858] New: ice for legal code with -O2 -ftree-vectorize dcb314 at hotmail dot com
                   ` (6 preceding siblings ...)
  2007-02-21 12:17 ` dcb314 at hotmail dot com
@ 2007-02-21 19:31 ` dorit at il dot ibm dot com
  2007-02-22  1:01 ` patchapp at dberlin dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dorit at il dot ibm dot com @ 2007-02-21 19:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from dorit at il dot ibm dot com  2007-02-21 19:31 -------
> Is this acceptable ?

sure, thanks


-- 


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


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

* [Bug tree-optimization/30858] [4.3 Regression] ice for legal code with -O2 -ftree-vectorize
  2007-02-19 11:59 [Bug c/30858] New: ice for legal code with -O2 -ftree-vectorize dcb314 at hotmail dot com
                   ` (7 preceding siblings ...)
  2007-02-21 19:31 ` dorit at il dot ibm dot com
@ 2007-02-22  1:01 ` patchapp at dberlin dot org
  2007-02-22  8:16 ` dorit at gcc dot gnu dot org
  2007-06-18  5:47 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: patchapp at dberlin dot org @ 2007-02-22  1:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from patchapp at dberlin dot org  2007-02-22 01:01 -------
Subject: Bug number PR30858

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-02/msg01774.html


-- 


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


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

* [Bug tree-optimization/30858] [4.3 Regression] ice for legal code with -O2 -ftree-vectorize
  2007-02-19 11:59 [Bug c/30858] New: ice for legal code with -O2 -ftree-vectorize dcb314 at hotmail dot com
                   ` (8 preceding siblings ...)
  2007-02-22  1:01 ` patchapp at dberlin dot org
@ 2007-02-22  8:16 ` dorit at gcc dot gnu dot org
  2007-06-18  5:47 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: dorit at gcc dot gnu dot org @ 2007-02-22  8:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from dorit at gcc dot gnu dot org  2007-02-22 08:16 -------
Subject: Bug 30858

Author: dorit
Date: Thu Feb 22 08:16:18 2007
New Revision: 122220

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122220
Log:
        PR tree-optimization/30858
        * tree-vectorizer.c (vect_is_simple_reduction): Check that the stmts
        in the reduction cycle have a single use in the loop.
        * tree-vectorizer.h (relevant): Add documentation.


Added:
    trunk/gcc/testsuite/gcc.dg/vect/pr30858.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vectorizer.c
    trunk/gcc/tree-vectorizer.h


-- 


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


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

* [Bug tree-optimization/30858] [4.3 Regression] ice for legal code with -O2 -ftree-vectorize
  2007-02-19 11:59 [Bug c/30858] New: ice for legal code with -O2 -ftree-vectorize dcb314 at hotmail dot com
                   ` (9 preceding siblings ...)
  2007-02-22  8:16 ` dorit at gcc dot gnu dot org
@ 2007-06-18  5:47 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-06-18  5:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from pinskia at gcc dot gnu dot org  2007-06-18 05:46 -------
Fixed.  This should have been closed a while back.


-- 

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=30858


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

end of thread, other threads:[~2007-06-18  5:47 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-19 11:59 [Bug c/30858] New: ice for legal code with -O2 -ftree-vectorize dcb314 at hotmail dot com
2007-02-19 11:59 ` [Bug c/30858] " dcb314 at hotmail dot com
2007-02-19 12:45 ` dorit at il dot ibm dot com
2007-02-19 12:56 ` dorit at il dot ibm dot com
2007-02-19 13:17 ` [Bug tree-optimization/30858] [4.3 Regression] " rguenth at gcc dot gnu dot org
2007-02-19 14:12 ` dorit at il dot ibm dot com
2007-02-20 22:56 ` dorit at il dot ibm dot com
2007-02-21 12:17 ` dcb314 at hotmail dot com
2007-02-21 19:31 ` dorit at il dot ibm dot com
2007-02-22  1:01 ` patchapp at dberlin dot org
2007-02-22  8:16 ` dorit at gcc dot gnu dot org
2007-06-18  5:47 ` pinskia 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).