public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/49926] New: ice in process_use, at tree-vect-stmts.c:405
@ 2011-07-31 21:37 regehr at cs dot utah.edu
  2011-07-31 22:34 ` [Bug tree-optimization/49926] [4.7 Regression] " jakub at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: regehr at cs dot utah.edu @ 2011-07-31 21:37 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: ice in process_use, at tree-vect-stmts.c:405
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: regehr@cs.utah.edu
                CC: chenyang@cs.utah.edu


[regehr@gamow tmp044]$ current-gcc -Ofast -c small.c -w
small.c: In function 'func_66':
small.c:4:6: internal compiler error: in process_use, at tree-vect-stmts.c:405
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
[regehr@gamow tmp044]$ cat small.c
int g_93;
int g_163;

void func_66 (int p_68, int p_69)
{
  int l_77[0];
  int *l_171 = &g_93;
  int l_201;
  int l_224;
 lbl_278:
  {
    int *l_225 = 0;
    *l_171 = (*l_225 = l_224, 0);
  }
  if (l_201 = p_68--)
    for (; g_163; g_163 += 1)
      {
    int *l_256 = &l_201;
    int *l_257 = &l_224;
    *l_257 = *l_256 &= *l_171 &= 1;
    *l_256 &= l_77[g_163];
      }
  goto lbl_278;
}
[regehr@gamow tmp044]$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r176967-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r176967-install
--program-prefix=r176967- --enable-languages=c,c++
Thread model: posix
gcc version 4.7.0 20110731 (experimental) (GCC) 
[regehr@gamow tmp044]$


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

* [Bug tree-optimization/49926] [4.7 Regression] ice in process_use, at tree-vect-stmts.c:405
  2011-07-31 21:37 [Bug c/49926] New: ice in process_use, at tree-vect-stmts.c:405 regehr at cs dot utah.edu
@ 2011-07-31 22:34 ` jakub at gcc dot gnu.org
  2011-07-31 22:52 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-07-31 22:34 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|                            |2011.07.31 22:33:53
          Component|c                           |tree-optimization
                 CC|                            |jakub at gcc dot gnu.org
     Ever Confirmed|0                           |1
            Summary|ice in process_use, at      |[4.7 Regression] ice in
                   |tree-vect-stmts.c:405       |process_use, at
                   |                            |tree-vect-stmts.c:405
   Target Milestone|---                         |4.7.0

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-07-31 22:33:53 UTC ---
Confirmed, started at http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173856
Reduced testcase at -O3 on x86_64-linux:
int b, c[10];

void
foo (unsigned int x, int y, int z, int *w)
{
  do
    {
      *w = z;
      y = x;
      if (y)
        for (b = -4; b; b++)
          {
            z = y &= 1;
            y &= c[b + 4];
          }
    }
  while (1);
}


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

* [Bug tree-optimization/49926] [4.7 Regression] ice in process_use, at tree-vect-stmts.c:405
  2011-07-31 21:37 [Bug c/49926] New: ice in process_use, at tree-vect-stmts.c:405 regehr at cs dot utah.edu
  2011-07-31 22:34 ` [Bug tree-optimization/49926] [4.7 Regression] " jakub at gcc dot gnu.org
@ 2011-07-31 22:52 ` jakub at gcc dot gnu.org
  2011-08-01  6:17 ` irar at il dot ibm.com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-07-31 22:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-07-31 22:51:30 UTC ---
Actually, that was over-simplified, that crashed just at r173856 and a few
hundred revisions afterwards, this fails even with current trunk at -O3:
int a, b, c[10];

void
foo (unsigned int x, int y, int z, int *w)
{
  do
    {
      *w = z;
      y = x;
      if (y)
        for (b = -4; b; b++)
          {
            z = y &= a &= 1;
            y &= c[b + 4];
          }
    }
  while (1);
}


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

* [Bug tree-optimization/49926] [4.7 Regression] ice in process_use, at tree-vect-stmts.c:405
  2011-07-31 21:37 [Bug c/49926] New: ice in process_use, at tree-vect-stmts.c:405 regehr at cs dot utah.edu
  2011-07-31 22:34 ` [Bug tree-optimization/49926] [4.7 Regression] " jakub at gcc dot gnu.org
  2011-07-31 22:52 ` jakub at gcc dot gnu.org
@ 2011-08-01  6:17 ` irar at il dot ibm.com
  2011-08-01 15:15 ` irar at il dot ibm.com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: irar at il dot ibm.com @ 2011-08-01  6:17 UTC (permalink / raw)
  To: gcc-bugs

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

Ira Rosen <irar at il dot ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |irar at il dot ibm.com
         AssignedTo|unassigned at gcc dot       |irar at gcc dot gnu.org
                   |gnu.org                     |


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

* [Bug tree-optimization/49926] [4.7 Regression] ice in process_use, at tree-vect-stmts.c:405
  2011-07-31 21:37 [Bug c/49926] New: ice in process_use, at tree-vect-stmts.c:405 regehr at cs dot utah.edu
                   ` (2 preceding siblings ...)
  2011-08-01  6:17 ` irar at il dot ibm.com
@ 2011-08-01 15:15 ` irar at il dot ibm.com
  2011-08-01 16:59 ` irar at gcc dot gnu.org
  2011-08-02  7:01 ` irar at il dot ibm.com
  5 siblings, 0 replies; 7+ messages in thread
From: irar at il dot ibm.com @ 2011-08-01 15:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Ira Rosen <irar at il dot ibm.com> 2011-08-01 15:14:50 UTC ---
I am testing this patch:

Index: tree-vect-loop.c
===================================================================
--- tree-vect-loop.c    (revision 177007)
+++ tree-vect-loop.c    (working copy)
@@ -1730,7 +1730,7 @@
   tree lhs;
   imm_use_iterator imm_iter;
   use_operand_p use_p;
-  int nloop_uses, size = 0;
+  int nloop_uses, size = 0, n_out_of_loop_uses;
   bool found = false;

   if (loop != vect_loop)
@@ -1741,6 +1741,7 @@
   while (1)
     {
       nloop_uses = 0;
+      n_out_of_loop_uses = 0;
       FOR_EACH_IMM_USE_FAST (use_p, imm_iter, lhs)
         {
          gimple use_stmt = USE_STMT (use_p);
@@ -1757,16 +1758,22 @@
               break;
             }

-          if (flow_bb_inside_loop_p (loop, gimple_bb (use_stmt))
-              && vinfo_for_stmt (use_stmt)
-             && !STMT_VINFO_IN_PATTERN_P (vinfo_for_stmt (use_stmt)))
-           {
-             loop_use_stmt = use_stmt;
-             nloop_uses++;
-           }
+          if (flow_bb_inside_loop_p (loop, gimple_bb (use_stmt)))
+            {
+              if (vinfo_for_stmt (use_stmt)
+                  && !STMT_VINFO_IN_PATTERN_P (vinfo_for_stmt (use_stmt)))
+                {
+                  loop_use_stmt = use_stmt;
+                  nloop_uses++;
+                }
+            }
+           else
+             n_out_of_loop_uses++;

-          if (nloop_uses > 1)
-            return false;
+           /* There are can be either a single use in the loop or two uses in
+              phi nodes.  */
+           if (nloop_uses > 1 || (n_out_of_loop_uses && nloop_uses))
+             return false;
         }

       if (found)


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

* [Bug tree-optimization/49926] [4.7 Regression] ice in process_use, at tree-vect-stmts.c:405
  2011-07-31 21:37 [Bug c/49926] New: ice in process_use, at tree-vect-stmts.c:405 regehr at cs dot utah.edu
                   ` (3 preceding siblings ...)
  2011-08-01 15:15 ` irar at il dot ibm.com
@ 2011-08-01 16:59 ` irar at gcc dot gnu.org
  2011-08-02  7:01 ` irar at il dot ibm.com
  5 siblings, 0 replies; 7+ messages in thread
From: irar at gcc dot gnu.org @ 2011-08-01 16:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from irar at gcc dot gnu.org 2011-08-01 16:58:24 UTC ---
Author: irar
Date: Mon Aug  1 16:58:20 2011
New Revision: 177063

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177063
Log:

        PR tree-optimization/49926
        * tree-vect-loop.c (vect_is_slp_reduction): Check that a
        statement in a chain doesn't have uses both inside and
        outside the loop.


Added:
    trunk/gcc/testsuite/gcc.dg/vect/pr49926.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-loop.c


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

* [Bug tree-optimization/49926] [4.7 Regression] ice in process_use, at tree-vect-stmts.c:405
  2011-07-31 21:37 [Bug c/49926] New: ice in process_use, at tree-vect-stmts.c:405 regehr at cs dot utah.edu
                   ` (4 preceding siblings ...)
  2011-08-01 16:59 ` irar at gcc dot gnu.org
@ 2011-08-02  7:01 ` irar at il dot ibm.com
  5 siblings, 0 replies; 7+ messages in thread
From: irar at il dot ibm.com @ 2011-08-02  7:01 UTC (permalink / raw)
  To: gcc-bugs

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

Ira Rosen <irar at il dot ibm.com> changed:

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

--- Comment #5 from Ira Rosen <irar at il dot ibm.com> 2011-08-02 07:01:05 UTC ---
Fixed.


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

end of thread, other threads:[~2011-08-02  7:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-31 21:37 [Bug c/49926] New: ice in process_use, at tree-vect-stmts.c:405 regehr at cs dot utah.edu
2011-07-31 22:34 ` [Bug tree-optimization/49926] [4.7 Regression] " jakub at gcc dot gnu.org
2011-07-31 22:52 ` jakub at gcc dot gnu.org
2011-08-01  6:17 ` irar at il dot ibm.com
2011-08-01 15:15 ` irar at il dot ibm.com
2011-08-01 16:59 ` irar at gcc dot gnu.org
2011-08-02  7:01 ` irar at il dot ibm.com

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