public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/37416]  New: Failure to return number of  loop iterations
@ 2008-09-08  6:39 irar at il dot ibm dot com
  2008-09-13 12:07 ` [Bug tree-optimization/37416] [4.4 Regression] " rguenth at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: irar at il dot ibm dot com @ 2008-09-08  6:39 UTC (permalink / raw)
  To: gcc-bugs

For the loop in testcase of pr36630:

void
foo (unsigned char *x, short y)
{
  short i;

  i = 2;
  while (i < y)
    {
      x[i - 1] = x[i];
      i = i + 1;
    }
}

we used to get 
# of iterations (short unsigned int) y_3(D) + 65533, bounded by 32764
and now we get scev_not_known.

Also Sebastian noticed (from pr36630):

> I also have remarked on one of the graphite testcases scop-matmult.c
> that we had a regression in the precision of the number of iterations from
> last graphite merge till yesterday's merge, i.e. from 138275 to 139870
> We used to have a symbolic number of iterations, but now the result
> is scev_dont_know.  I have not yet tracked this down to the patch that
> produced this regression.
> 
> Sebastian


-- 
           Summary: Failure to return number of  loop iterations
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: irar at il dot ibm dot com


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


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

* [Bug tree-optimization/37416] [4.4 Regression] Failure to return number of  loop iterations
  2008-09-08  6:39 [Bug tree-optimization/37416] New: Failure to return number of loop iterations irar at il dot ibm dot com
@ 2008-09-13 12:07 ` rguenth at gcc dot gnu dot org
  2008-10-22  3:08 ` mmitchel at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-09-13 12:07 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org
           Keywords|                            |missed-optimization
      Known to fail|                            |4.4.0
            Summary|Failure to return number of |[4.4 Regression] Failure to
                   |loop iterations             |return number of  loop
                   |                            |iterations
   Target Milestone|---                         |4.4.0


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


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

* [Bug tree-optimization/37416] [4.4 Regression] Failure to return number of  loop iterations
  2008-09-08  6:39 [Bug tree-optimization/37416] New: Failure to return number of loop iterations irar at il dot ibm dot com
  2008-09-13 12:07 ` [Bug tree-optimization/37416] [4.4 Regression] " rguenth at gcc dot gnu dot org
@ 2008-10-22  3:08 ` mmitchel at gcc dot gnu dot org
  2008-11-21 20:58 ` steven at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2008-10-22  3:08 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


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

* [Bug tree-optimization/37416] [4.4 Regression] Failure to return number of  loop iterations
  2008-09-08  6:39 [Bug tree-optimization/37416] New: Failure to return number of loop iterations irar at il dot ibm dot com
  2008-09-13 12:07 ` [Bug tree-optimization/37416] [4.4 Regression] " rguenth at gcc dot gnu dot org
  2008-10-22  3:08 ` mmitchel at gcc dot gnu dot org
@ 2008-11-21 20:58 ` steven at gcc dot gnu dot org
  2008-11-22 15:10 ` irar at il dot ibm dot com
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: steven at gcc dot gnu dot org @ 2008-11-21 20:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from steven at gcc dot gnu dot org  2008-11-21 20:57 -------
This bug is shamefully incomplete.  There is no way anyone willing to give this
a look can know what to look for.

For example, a few things one would have to know before he/she can even begin
to consider whether/how to analyze the problem:
1. What is the target where you see this?
2. What compiler flags are you using?
3. Where do you look for the number of iterations (which dump)?
4. What "missed-optimization" does this cause (something not vectorized)?

Please read http://gcc.gnu.org/bugs.html#report before filing more bugs.


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


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


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

* [Bug tree-optimization/37416] [4.4 Regression] Failure to return number of  loop iterations
  2008-09-08  6:39 [Bug tree-optimization/37416] New: Failure to return number of loop iterations irar at il dot ibm dot com
                   ` (2 preceding siblings ...)
  2008-11-21 20:58 ` steven at gcc dot gnu dot org
@ 2008-11-22 15:10 ` irar at il dot ibm dot com
  2008-11-22 15:49 ` rguenth at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: irar at il dot ibm dot com @ 2008-11-22 15:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from irar at il dot ibm dot com  2008-11-22 15:08 -------
(In reply to comment #1)
> This bug is shamefully incomplete.  There is no way anyone willing to give this
> a look can know what to look for.
> For example, a few things one would have to know before he/she can even begin
> to consider whether/how to analyze the problem:
> 1. What is the target where you see this?
> 2. What compiler flags are you using?
-O3

> 3. Where do you look for the number of iterations (which dump)?
vectorizer's dump

> 4. What "missed-optimization" does this cause (something not vectorized)?
the loop is not vectorized because the number of iterations is unknown

> Please read http://gcc.gnu.org/bugs.html#report before filing more bugs.


-- 

irar at il dot ibm dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  GCC build triplet|                            |x86_64-suse-linux
   GCC host triplet|                            |x86_64-suse-linux
 GCC target triplet|                            |x86_64-suse-linux


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


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

* [Bug tree-optimization/37416] [4.4 Regression] Failure to return number of  loop iterations
  2008-09-08  6:39 [Bug tree-optimization/37416] New: Failure to return number of loop iterations irar at il dot ibm dot com
                   ` (3 preceding siblings ...)
  2008-11-22 15:10 ` irar at il dot ibm dot com
@ 2008-11-22 15:49 ` rguenth at gcc dot gnu dot org
  2008-12-09 17:16 ` jakub at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-11-22 15:49 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-11-22 15:47:53
               date|                            |


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


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

* [Bug tree-optimization/37416] [4.4 Regression] Failure to return number of  loop iterations
  2008-09-08  6:39 [Bug tree-optimization/37416] New: Failure to return number of loop iterations irar at il dot ibm dot com
                   ` (4 preceding siblings ...)
  2008-11-22 15:49 ` rguenth at gcc dot gnu dot org
@ 2008-12-09 17:16 ` jakub at gcc dot gnu dot org
  2008-12-09 20:38 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-12-09 17:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2008-12-09 17:14 -------
> I have not yet tracked this down to the patch that produced this regression.

I have tracked this down to r138207 AKA tuples branch merge.
*.ifcvt dump looks the same (the only difference is:
-  # SMT.10D.1968_19 = PHI <SMT.10D.1968_16(5), SMT.10D.1968_15(D)(3)>
   # iD.1947_18 = PHI <iD.1947_13(5), 2(3)>
+  # SMT.10D.1968_19 = PHI <SMT.10D.1968_16(5), SMT.10D.1968_15(D)(3)>
), I'll try to debug this side by side where it differs.


-- 


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


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

* [Bug tree-optimization/37416] [4.4 Regression] Failure to return number of  loop iterations
  2008-09-08  6:39 [Bug tree-optimization/37416] New: Failure to return number of loop iterations irar at il dot ibm dot com
                   ` (5 preceding siblings ...)
  2008-12-09 17:16 ` jakub at gcc dot gnu dot org
@ 2008-12-09 20:38 ` jakub at gcc dot gnu dot org
  2008-12-09 22:50 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-12-09 20:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2008-12-09 20:37 -------
Indeed, tuplification bug.  The following makes the testcase vectorizable
again.
gcc 4.3 had:
Symbolic number of iterations is (short unsigned int) y_3(D) + 65534
and so does trunk with this patch:
--- gcc/tree-scalar-evolution.c.jj      2008-11-10 10:28:26.000000000 +0100
+++ gcc/tree-scalar-evolution.c 2008-12-09 21:17:10.000000000 +0100
@@ -1229,6 +1229,18 @@ follow_ssa_edge_in_rhs (struct loop *loo
     case GIMPLE_SINGLE_RHS:
       return follow_ssa_edge_expr (loop, stmt, gimple_assign_rhs1 (stmt),
                                   halting_phi, evolution_of_loop, limit);
+    case GIMPLE_UNARY_RHS:
+      if (code == NOP_EXPR)
+       {
+         /* This assignment is under the form "a_1 = (cast) rhs.  */
+         t_bool res
+           = follow_ssa_edge_expr (loop, stmt, gimple_assign_rhs1 (stmt),
+                                   halting_phi, evolution_of_loop, limit);
+         *evolution_of_loop = chrec_convert (type, *evolution_of_loop, stmt);
+         return res;
+       }
+      /* FALLTHRU */
+
     default:
       return t_false;
     }


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-11-22 15:47:53         |2008-12-09 20:37:03
               date|                            |


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


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

* [Bug tree-optimization/37416] [4.4 Regression] Failure to return number of  loop iterations
  2008-09-08  6:39 [Bug tree-optimization/37416] New: Failure to return number of loop iterations irar at il dot ibm dot com
                   ` (6 preceding siblings ...)
  2008-12-09 20:38 ` jakub at gcc dot gnu dot org
@ 2008-12-09 22:50 ` jakub at gcc dot gnu dot org
  2008-12-10 10:50 ` jakub at gcc dot gnu dot org
  2008-12-10 10:55 ` jakub at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-12-09 22:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jakub at gcc dot gnu dot org  2008-12-09 22:48 -------
Subject: Bug 37416

Author: jakub
Date: Tue Dec  9 22:47:20 2008
New Revision: 142616

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142616
Log:
        PR tree-optimization/37416
        * tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Handle NOP_EXPR.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-scalar-evolution.c


-- 


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


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

* [Bug tree-optimization/37416] [4.4 Regression] Failure to return number of  loop iterations
  2008-09-08  6:39 [Bug tree-optimization/37416] New: Failure to return number of loop iterations irar at il dot ibm dot com
                   ` (7 preceding siblings ...)
  2008-12-09 22:50 ` jakub at gcc dot gnu dot org
@ 2008-12-10 10:50 ` jakub at gcc dot gnu dot org
  2008-12-10 10:55 ` jakub at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-12-10 10:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jakub at gcc dot gnu dot org  2008-12-10 10:48 -------
Subject: Bug 37416

Author: jakub
Date: Wed Dec 10 10:47:22 2008
New Revision: 142643

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142643
Log:
        PR tree-optimization/37416
        * gcc.dg/vect/pr36630.c: Expect 1 vectorized loop.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/vect/pr36630.c


-- 


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


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

* [Bug tree-optimization/37416] [4.4 Regression] Failure to return number of  loop iterations
  2008-09-08  6:39 [Bug tree-optimization/37416] New: Failure to return number of loop iterations irar at il dot ibm dot com
                   ` (8 preceding siblings ...)
  2008-12-10 10:50 ` jakub at gcc dot gnu dot org
@ 2008-12-10 10:55 ` jakub at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-12-10 10:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jakub at gcc dot gnu dot org  2008-12-10 10:49 -------
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2008-12-10 10:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-08  6:39 [Bug tree-optimization/37416] New: Failure to return number of loop iterations irar at il dot ibm dot com
2008-09-13 12:07 ` [Bug tree-optimization/37416] [4.4 Regression] " rguenth at gcc dot gnu dot org
2008-10-22  3:08 ` mmitchel at gcc dot gnu dot org
2008-11-21 20:58 ` steven at gcc dot gnu dot org
2008-11-22 15:10 ` irar at il dot ibm dot com
2008-11-22 15:49 ` rguenth at gcc dot gnu dot org
2008-12-09 17:16 ` jakub at gcc dot gnu dot org
2008-12-09 20:38 ` jakub at gcc dot gnu dot org
2008-12-09 22:50 ` jakub at gcc dot gnu dot org
2008-12-10 10:50 ` jakub at gcc dot gnu dot org
2008-12-10 10:55 ` jakub 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).