public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/49121] New: [4.7 Regression] FAIL: gcc.dg/tree-ssa/ivopt_infer_2.c scan-tree-dump-times ivopts "Replacing" 0
@ 2011-05-23 11:54 rguenth at gcc dot gnu.org
  2011-05-23 12:19 ` [Bug tree-optimization/49121] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-05-23 11:54 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: [4.7 Regression] FAIL: gcc.dg/tree-ssa/ivopt_infer_2.c
                    scan-tree-dump-times ivopts "Replacing" 0
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org
            Target: x86_64-*-*


The test fails on x86_64-*-* at least.  That's possibly wrong-code.


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

* [Bug tree-optimization/49121] [4.7 Regression] FAIL: gcc.dg/tree-ssa/ivopt_infer_2.c scan-tree-dump-times ivopts "Replacing" 0
  2011-05-23 11:54 [Bug tree-optimization/49121] New: [4.7 Regression] FAIL: gcc.dg/tree-ssa/ivopt_infer_2.c scan-tree-dump-times ivopts "Replacing" 0 rguenth at gcc dot gnu.org
@ 2011-05-23 12:19 ` rguenth at gcc dot gnu.org
  2011-05-23 14:47 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-05-23 12:19 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.7.0


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

* [Bug tree-optimization/49121] [4.7 Regression] FAIL: gcc.dg/tree-ssa/ivopt_infer_2.c scan-tree-dump-times ivopts "Replacing" 0
  2011-05-23 11:54 [Bug tree-optimization/49121] New: [4.7 Regression] FAIL: gcc.dg/tree-ssa/ivopt_infer_2.c scan-tree-dump-times ivopts "Replacing" 0 rguenth at gcc dot gnu.org
  2011-05-23 12:19 ` [Bug tree-optimization/49121] " rguenth at gcc dot gnu.org
@ 2011-05-23 14:47 ` rguenth at gcc dot gnu.org
  2011-05-23 15:13 ` hjl.tools at gmail dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-05-23 14:47 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl.tools at gmail dot com

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-05-23 14:08:40 UTC ---
*** Bug 49124 has been marked as a duplicate of this bug. ***


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

* [Bug tree-optimization/49121] [4.7 Regression] FAIL: gcc.dg/tree-ssa/ivopt_infer_2.c scan-tree-dump-times ivopts "Replacing" 0
  2011-05-23 11:54 [Bug tree-optimization/49121] New: [4.7 Regression] FAIL: gcc.dg/tree-ssa/ivopt_infer_2.c scan-tree-dump-times ivopts "Replacing" 0 rguenth at gcc dot gnu.org
  2011-05-23 12:19 ` [Bug tree-optimization/49121] " rguenth at gcc dot gnu.org
  2011-05-23 14:47 ` rguenth at gcc dot gnu.org
@ 2011-05-23 15:13 ` hjl.tools at gmail dot com
  2011-05-23 15:33 ` vries at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2011-05-23 15:13 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.05.23 14:34:51
     Ever Confirmed|0                           |1

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> 2011-05-23 14:34:51 UTC ---
It is caused by revision 174056:

http://gcc.gnu.org/ml/gcc-cvs/2011-05/msg00837.html


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

* [Bug tree-optimization/49121] [4.7 Regression] FAIL: gcc.dg/tree-ssa/ivopt_infer_2.c scan-tree-dump-times ivopts "Replacing" 0
  2011-05-23 11:54 [Bug tree-optimization/49121] New: [4.7 Regression] FAIL: gcc.dg/tree-ssa/ivopt_infer_2.c scan-tree-dump-times ivopts "Replacing" 0 rguenth at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2011-05-23 15:13 ` hjl.tools at gmail dot com
@ 2011-05-23 15:33 ` vries at gcc dot gnu.org
  2011-05-23 16:44 ` vries at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: vries at gcc dot gnu.org @ 2011-05-23 15:33 UTC (permalink / raw)
  To: gcc-bugs

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

vries at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |UNCONFIRMED
                 CC|                            |vries at gcc dot gnu.org
         AssignedTo|unassigned at gcc dot       |vries at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|1                           |0


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

* [Bug tree-optimization/49121] [4.7 Regression] FAIL: gcc.dg/tree-ssa/ivopt_infer_2.c scan-tree-dump-times ivopts "Replacing" 0
  2011-05-23 11:54 [Bug tree-optimization/49121] New: [4.7 Regression] FAIL: gcc.dg/tree-ssa/ivopt_infer_2.c scan-tree-dump-times ivopts "Replacing" 0 rguenth at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2011-05-23 15:33 ` vries at gcc dot gnu.org
@ 2011-05-23 16:44 ` vries at gcc dot gnu.org
  2011-05-24  8:39 ` vries at gcc dot gnu.org
  2011-05-24  9:41 ` vries at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: vries at gcc dot gnu.org @ 2011-05-23 16:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from vries at gcc dot gnu.org 2011-05-23 16:07:04 UTC ---
test case:
...
#ifndef TYPE
#define TYPE char*
#endif

extern int a[];

/* Can not infer loop iteration from array -- exit test can not be replaced. 
*/
void foo (int i_width, TYPE dst, TYPE src1, TYPE src2)
{
      TYPE dstn= dst + i_width;
      TYPE dst0 = dst;
      unsigned long long i = 0;
       for( ; dst <= dstn; )
       {
           dst0[i] = ( src1[i] + src2[i] + 1 +a[i]) >> 1;
           dst++;
       i += 16;
       }
}
...

test case representation at ivopts:
...
foo (int i_width, char * dst, char * src1, char * src2)
{
  long long unsigned int i;
  char * dstn;
  char D.2707;
  int D.2706;
  int D.2705;
  int D.2704;
  int D.2703;
  int D.2702;
  int D.2701;
  char D.2700;
  char * D.2699;
  int D.2698;
  char D.2697;
  char * D.2696;
  char * D.2695;
  long unsigned int D.2694;

<bb 2>:
  D.2694_4 = (long unsigned int) i_width_3(D);
  dstn_6 = dst_5(D) + D.2694_4;
  if (dst_5(D) <= dstn_6)
    goto <bb 3>;
  else
    goto <bb 7>;

<bb 3>:

<bb 4>:
  # dst_32 = PHI <dst_24(5), dst_5(D)(3)>
  # i_33 = PHI <i_25(5), 0(3)>
  D.2695_9 = dst_5(D) + i_33;
  D.2696_11 = src1_10(D) + i_33;
  D.2697_12 = *D.2696_11;
  D.2698_13 = (int) D.2697_12;
  D.2699_15 = src2_14(D) + i_33;
  D.2700_16 = *D.2699_15;
  D.2701_17 = (int) D.2700_16;
  D.2702_18 = D.2698_13 + D.2701_17;
  D.2703_19 = D.2702_18 + 1;
  D.2704_20 = a[i_33];
  D.2705_21 = D.2703_19 + D.2704_20;
  D.2706_22 = D.2705_21 >> 1;
  D.2707_23 = (char) D.2706_22;
  *D.2695_9 = D.2707_23;
  dst_24 = dst_32 + 1;
  i_25 = i_33 + 16;
  if (dstn_6 >= dst_24)
    goto <bb 5>;
  else
    goto <bb 6>;

<bb 5>:
  goto <bb 4>;

<bb 6>:

<bb 7>:
  return;

}
...

the patch causes estimated_loop_iterations (loop, true, &max_niter) in
may_eliminate_iv to return a different value:
without patch: 0x10000000000000000
with    patch: 0x01000000000000000

The analysis in the patch concludes that the pointer arithmetic statement
  D.2695_9 = dst_5(D) + i_33
can only be executed 0x01000000000000000 times, based on the fact that i is
incremented with 16 each iteration. Note that the statement corresponds to the
pointer arithmetic in 'dst0[i]'.

Since the proposed new char pointer iterator can represent 0x10000000000000000
distinct values, may_eliminate_iv returns true, and the exit test is replaced:
...
Replacing exit test: if (dstn_6 >= dst_24)
...

This causes the check:
...
/* { dg-final { scan-tree-dump-times "Replacing" 0 "ivopts"} } */
...
to fail.

The test case needs to be adapted.


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

* [Bug tree-optimization/49121] [4.7 Regression] FAIL: gcc.dg/tree-ssa/ivopt_infer_2.c scan-tree-dump-times ivopts "Replacing" 0
  2011-05-23 11:54 [Bug tree-optimization/49121] New: [4.7 Regression] FAIL: gcc.dg/tree-ssa/ivopt_infer_2.c scan-tree-dump-times ivopts "Replacing" 0 rguenth at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2011-05-23 16:44 ` vries at gcc dot gnu.org
@ 2011-05-24  8:39 ` vries at gcc dot gnu.org
  2011-05-24  9:41 ` vries at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: vries at gcc dot gnu.org @ 2011-05-24  8:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from vries at gcc dot gnu.org 2011-05-24 08:09:03 UTC ---
Author: vries
Date: Tue May 24 08:09:00 2011
New Revision: 174103

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174103
Log:
2011-05-24  Tom de Vries  <tom@codesourcery.com>

    PR tree-optimization/49121
    * gcc.dg/tree-ssa/ivopt_infer_2.c: Adapt test.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/tree-ssa/ivopt_infer_2.c


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

* [Bug tree-optimization/49121] [4.7 Regression] FAIL: gcc.dg/tree-ssa/ivopt_infer_2.c scan-tree-dump-times ivopts "Replacing" 0
  2011-05-23 11:54 [Bug tree-optimization/49121] New: [4.7 Regression] FAIL: gcc.dg/tree-ssa/ivopt_infer_2.c scan-tree-dump-times ivopts "Replacing" 0 rguenth at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2011-05-24  8:39 ` vries at gcc dot gnu.org
@ 2011-05-24  9:41 ` vries at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: vries at gcc dot gnu.org @ 2011-05-24  9:41 UTC (permalink / raw)
  To: gcc-bugs

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

vries at gcc dot gnu.org changed:

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

--- Comment #5 from vries at gcc dot gnu.org 2011-05-24 08:15:49 UTC ---
Testcase has been adapted. Marking fixed.


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

end of thread, other threads:[~2011-05-24  8:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-23 11:54 [Bug tree-optimization/49121] New: [4.7 Regression] FAIL: gcc.dg/tree-ssa/ivopt_infer_2.c scan-tree-dump-times ivopts "Replacing" 0 rguenth at gcc dot gnu.org
2011-05-23 12:19 ` [Bug tree-optimization/49121] " rguenth at gcc dot gnu.org
2011-05-23 14:47 ` rguenth at gcc dot gnu.org
2011-05-23 15:13 ` hjl.tools at gmail dot com
2011-05-23 15:33 ` vries at gcc dot gnu.org
2011-05-23 16:44 ` vries at gcc dot gnu.org
2011-05-24  8:39 ` vries at gcc dot gnu.org
2011-05-24  9:41 ` vries at gcc dot gnu.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).