public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/50802] New: [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os
@ 2011-10-19 23:14 danglin at gcc dot gnu.org
  2011-10-20  9:01 ` [Bug middle-end/50802] " rguenth at gcc dot gnu.org
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-10-19 23:14 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50802
           Summary: [4.7 Regression] FAIL:
                    gcc.c-torture/execute/arith-rand-ll.c execution at -O2
                    and -Os
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: danglin@gcc.gnu.org
              Host: hppa2.0w-hp-hpux11.11
            Target: hppa2.0w-hp-hpux11.11
             Build: hppa2.0w-hp-hpux11.11


PASS: gcc.c-torture/execute/arith-rand-ll.c execution,  -O1 
Executing on host: /test/gnu/gcc/objdir/gcc/xgcc -B/test/gnu/gcc/objdir/gcc/
/te
st/gnu/gcc/gcc/gcc/testsuite/gcc.c-torture/execute/arith-rand-ll.c   -w  -O2  
-
lm   -o /test/gnu/gcc/objdir/gcc/testsuite/gcc/arith-rand-ll.x2    (timeout =
30
0)
PASS: gcc.c-torture/execute/arith-rand-ll.c compilation,  -O2 
Setting LD_LIBRARY_PATH to :/test/gnu/gcc/objdir/gcc::/test/gnu/gcc/objdir/gcc
FAIL: gcc.c-torture/execute/arith-rand-ll.c execution,  -O2


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

* [Bug middle-end/50802] [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os
  2011-10-19 23:14 [Bug middle-end/50802] New: [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os danglin at gcc dot gnu.org
@ 2011-10-20  9:01 ` rguenth at gcc dot gnu.org
  2011-10-23 19:54 ` danglin at gcc dot gnu.org
                   ` (21 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-10-20  9:01 UTC (permalink / raw)
  To: gcc-bugs

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

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

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


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

* [Bug middle-end/50802] [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os
  2011-10-19 23:14 [Bug middle-end/50802] New: [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os danglin at gcc dot gnu.org
  2011-10-20  9:01 ` [Bug middle-end/50802] " rguenth at gcc dot gnu.org
@ 2011-10-23 19:54 ` danglin at gcc dot gnu.org
  2011-10-24  0:02 ` [Bug tree-optimization/50802] " danglin at gcc dot gnu.org
                   ` (20 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-10-23 19:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from John David Anglin <danglin at gcc dot gnu.org> 2011-10-23 19:54:21 UTC ---
The abort occurs in this block:

      { signed char xx = x, yy = y, r1, r2;
        r1 = xx / yy;
        r2 = xx % yy;
        if (ABS (r2) >= (unsigned char) ABS (yy) || (signed char) (r1 * yy +
r2) != xx)
          abort ();
      }

for i = 2.

The test doesn't fail if I simply reduce the testcase to the above
and add a check for yy = 0.  My impression is the above fails because
the it is using r1 and r2 values from this block:

      { signed short xx = x, yy = y, r1, r2;        r1 = xx / yy;
        r2 = xx % yy;
        if (ABS (r2) >= (unsigned short) ABS (yy) || (signed short) (r1 * yy +
r
2) != xx)
          abort ();
      }

These are the values that cause the abort:

(gdb) p/x x
$79 = 0x1f801ff80ffff
(gdb) p/x y
$80 = 0x7f8007ffff8007ff
(gdb) p/x xx
$81 = 0xff
(gdb) p/x yy
$82 = 0xff
(gdb) p/x r2
$83 = 0xff
(gdb) p/x r1
$84 = 0x0

The r2 value is wrong.


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

* [Bug tree-optimization/50802] [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os
  2011-10-19 23:14 [Bug middle-end/50802] New: [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os danglin at gcc dot gnu.org
  2011-10-20  9:01 ` [Bug middle-end/50802] " rguenth at gcc dot gnu.org
  2011-10-23 19:54 ` danglin at gcc dot gnu.org
@ 2011-10-24  0:02 ` danglin at gcc dot gnu.org
  2011-10-27 11:21 ` rguenth at gcc dot gnu.org
                   ` (19 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-10-24  0:02 UTC (permalink / raw)
  To: gcc-bugs

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

John David Anglin <danglin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|middle-end                  |tree-optimization

--- Comment #2 from John David Anglin <danglin at gcc dot gnu.org> 2011-10-24 00:02:06 UTC ---
Introduced by the following change:

2011-10-17  Richard Guenther  <rguenther@suse.de>

    PR tree-optimization/50729
    * tree-vrp.c (extract_range_from_unary_expr_1): Remove
    redundant test.
    (simplify_conversion_using_ranges): Properly test the
    intermediate result.


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

* [Bug tree-optimization/50802] [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os
  2011-10-19 23:14 [Bug middle-end/50802] New: [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os danglin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2011-10-24  0:02 ` [Bug tree-optimization/50802] " danglin at gcc dot gnu.org
@ 2011-10-27 11:21 ` rguenth at gcc dot gnu.org
  2011-10-27 11:50 ` dave.anglin at bell dot net
                   ` (18 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-10-27 11:21 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2011-10-27
     Ever Confirmed|0                           |1

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-10-27 11:21:09 UTC ---
Is (sizeof (int) == sizeof (long long))?  What else could be target
specific here?  VRP is target agnostic ... can you post detail VRP dumps
from before and after the patch?


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

* [Bug tree-optimization/50802] [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os
  2011-10-19 23:14 [Bug middle-end/50802] New: [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os danglin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2011-10-27 11:21 ` rguenth at gcc dot gnu.org
@ 2011-10-27 11:50 ` dave.anglin at bell dot net
  2011-10-30 20:00 ` danglin at gcc dot gnu.org
                   ` (17 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: dave.anglin at bell dot net @ 2011-10-27 11:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from dave.anglin at bell dot net 2011-10-27 11:50:36 UTC ---
On 27-Oct-11, at 7:21 AM, rguenth at gcc dot gnu.org wrote:

> Is (sizeof (int) == sizeof (long long))?  What else could be target
> specific here?  VRP is target agnostic ... can you post detail VRP  
> dumps
> from before and after the patch?


No.  My debugging indicated that the problem was signed char and
short.  Maybe the issue is LOAD_EXTEND_OP which is ZERO_EXTEND
on pa.

I'll work on getting the dumps but it won't be before this evening,  
maybe
weekend.

Dave
--
John David Anglin    dave.anglin@bell.net


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

* [Bug tree-optimization/50802] [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os
  2011-10-19 23:14 [Bug middle-end/50802] New: [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os danglin at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2011-10-27 11:50 ` dave.anglin at bell dot net
@ 2011-10-30 20:00 ` danglin at gcc dot gnu.org
  2011-11-07  1:05 ` danglin at gcc dot gnu.org
                   ` (16 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-10-30 20:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from John David Anglin <danglin at gcc dot gnu.org> 2011-10-30 19:59:27 UTC ---
Created attachment 25668
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25668
vrp dumps


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

* [Bug tree-optimization/50802] [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os
  2011-10-19 23:14 [Bug middle-end/50802] New: [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os danglin at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2011-10-30 20:00 ` danglin at gcc dot gnu.org
@ 2011-11-07  1:05 ` danglin at gcc dot gnu.org
  2011-11-07 11:07 ` rguenth at gcc dot gnu.org
                   ` (15 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-11-07  1:05 UTC (permalink / raw)
  To: gcc-bugs

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

John David Anglin <danglin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
                 CC|                            |rguenth at gcc dot gnu.org


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

* [Bug tree-optimization/50802] [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os
  2011-10-19 23:14 [Bug middle-end/50802] New: [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os danglin at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2011-11-07  1:05 ` danglin at gcc dot gnu.org
@ 2011-11-07 11:07 ` rguenth at gcc dot gnu.org
  2011-11-07 12:49 ` dave.anglin at bell dot net
                   ` (14 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-11-07 11:07 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-11-07 11:07:34 UTC ---
Hm, with a cross I cannot reproduce the IL you posted (on trunk head, that is).
Is hppa2.0w-hp-hpux11.11 a host-wide-int 32bit host?  (no idea how I can
force HWI 32bit here :/)

Can you attach -fdump-tree-vrp-details dumps for trunk head?


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

* [Bug tree-optimization/50802] [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os
  2011-10-19 23:14 [Bug middle-end/50802] New: [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os danglin at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2011-11-07 11:07 ` rguenth at gcc dot gnu.org
@ 2011-11-07 12:49 ` dave.anglin at bell dot net
  2011-11-07 14:46 ` dave.anglin at bell dot net
                   ` (13 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: dave.anglin at bell dot net @ 2011-11-07 12:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from dave.anglin at bell dot net 2011-11-07 12:48:30 UTC ---
On 7-Nov-11, at 6:07 AM, rguenth at gcc dot gnu.org wrote:

> Is hppa2.0w-hp-hpux11.11 a host-wide-int 32bit host?  (no idea how I  
> can
> force HWI 32bit here :/)


No, it's 64 bits.

--
John David Anglin    dave.anglin@bell.net


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

* [Bug tree-optimization/50802] [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os
  2011-10-19 23:14 [Bug middle-end/50802] New: [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os danglin at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2011-11-07 12:49 ` dave.anglin at bell dot net
@ 2011-11-07 14:46 ` dave.anglin at bell dot net
  2011-11-07 14:47 ` dave.anglin at bell dot net
                   ` (12 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: dave.anglin at bell dot net @ 2011-11-07 14:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from dave.anglin at bell dot net 2011-11-07 14:44:52 UTC ---
Created attachment 25738
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25738
arith-rand-ll.c.124t.vrp2


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

* [Bug tree-optimization/50802] [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os
  2011-10-19 23:14 [Bug middle-end/50802] New: [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os danglin at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2011-11-07 14:46 ` dave.anglin at bell dot net
@ 2011-11-07 14:47 ` dave.anglin at bell dot net
  2011-11-07 15:21 ` rguenth at gcc dot gnu.org
                   ` (11 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: dave.anglin at bell dot net @ 2011-11-07 14:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from dave.anglin at bell dot net 2011-11-07 14:44:50 UTC ---
On 11/7/2011 6:07 AM, rguenth at gcc dot gnu.org wrote:
> Can you attach -fdump-tree-vrp-details dumps for trunk head?

Attached.


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

* [Bug tree-optimization/50802] [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os
  2011-10-19 23:14 [Bug middle-end/50802] New: [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os danglin at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2011-11-07 14:47 ` dave.anglin at bell dot net
@ 2011-11-07 15:21 ` rguenth at gcc dot gnu.org
  2011-11-07 16:15 ` dave.anglin at bell dot net
                   ` (10 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-11-07 15:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-11-07 15:09:54 UTC ---
Weird.  My cross configured with

/space/rguenther/src/svn/trunk/configure --enable-languages=c,c++,fortran
--disable-nls --target=hppa2.0w-hp-hpux11.11

does not reproduce this.  I'm using ./cc1 -O2 on arith-rand-ll.c, and I'm
getting

arith-rand-ll.c: In function 'main':
arith-rand-ll.c:59:4: warning: incompatible implicit declaration of built-in
function 'abort' [enabled by default]
...

not sure if that's related.

>From your dump file:

x_118: [0, +INF]  EQUIVALENCES: { x_5 D.2243_12 } (2 elements)
xx_56: VARYING
D.2297_58: [-32768, 32767]

xx_56 = (short int) x_118;
Folding statement: D.2297_58 = (int) xx_56;
Folded into: D.2297_58 = (int) x_118;

should be reproducible with

extern void abort (void);

long long unsigned int x = 1 << (sizeof (short int) * 8);

int main()
{
  if (x >= 0)
    {
      short int xx = (short int)x;
      if (xx != 0)
        abort ();
    }
  return 0;
}

but that works for me ... does this fail for you?  Looking at the above
it _appears_ that x is signed!?  The reported value-range should be

x_5: VARYING

which it is indeed when compiling with my cross ...

Is, by any chance, the middle-end sizetype == long long unsigned int?
And for some weird reason those are mapped together?


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

* [Bug tree-optimization/50802] [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os
  2011-10-19 23:14 [Bug middle-end/50802] New: [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os danglin at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2011-11-07 15:21 ` rguenth at gcc dot gnu.org
@ 2011-11-07 16:15 ` dave.anglin at bell dot net
  2011-11-07 16:20 ` dave.anglin at bell dot net
                   ` (9 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: dave.anglin at bell dot net @ 2011-11-07 16:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from dave.anglin at bell dot net 2011-11-07 16:11:55 UTC ---
On 11/7/2011 10:09 AM, rguenth at gcc dot gnu.org wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50802
>
> --- Comment #10 from Richard Guenther<rguenth at gcc dot gnu.org>  2011-11-07 15:09:54 UTC ---
> Weird.  My cross configured with
>
> /space/rguenther/src/svn/trunk/configure --enable-languages=c,c++,fortran
> --disable-nls --target=hppa2.0w-hp-hpux11.11
>
> does not reproduce this.  I'm using ./cc1 -O2 on arith-rand-ll.c, and I'm
> getting
>
> arith-rand-ll.c: In function 'main':
> arith-rand-ll.c:59:4: warning: incompatible implicit declaration of built-in
> function 'abort' [enabled by default]
> ...

I see the same if I remove the "-w" option from the test.

> not sure if that's related.
>
> > From your dump file:
>
> x_118: [0, +INF]  EQUIVALENCES: { x_5 D.2243_12 } (2 elements)
> xx_56: VARYING
> D.2297_58: [-32768, 32767]
>
> xx_56 = (short int) x_118;
> Folding statement: D.2297_58 = (int) xx_56;
> Folded into: D.2297_58 = (int) x_118;
>
> should be reproducible with
>
> extern void abort (void);
>
> long long unsigned int x = 1<<  (sizeof (short int) * 8);
>
> int main()
> {
>    if (x>= 0)
>      {
>        short int xx = (short int)x;
>        if (xx != 0)
>          abort ();
>      }
>    return 0;
> }
>
> but that works for me ... does this fail for you?  Looking at the above
The above  test doesn't fail.  I've attached the detail vrp dumps as 
they don't seem
to match what you described below.
> it _appears_ that x is signed!?  The reported value-range should be
>
> x_5: VARYING
>
> which it is indeed when compiling with my cross ...
>
> Is, by any chance, the middle-end sizetype == long long unsigned int?
> And for some weird reason those are mapped together?
>
Looking at the hwi issue, I see that need_64bit_hwint is not defined for 
this target,
or for the 32-bit hppa-linux target.  Test fails on both.  However, it 
doesn't fail on
hppa64-hp-hpux11.11 where need_64bit_hwint is defined (long is 64 bits).
Suspect a cross from hppa64-hp-hpux11.11 would work.


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

* [Bug tree-optimization/50802] [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os
  2011-10-19 23:14 [Bug middle-end/50802] New: [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os danglin at gcc dot gnu.org
                   ` (12 preceding siblings ...)
  2011-11-07 16:15 ` dave.anglin at bell dot net
@ 2011-11-07 16:20 ` dave.anglin at bell dot net
  2011-11-17  2:34 ` danglin at gcc dot gnu.org
                   ` (8 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: dave.anglin at bell dot net @ 2011-11-07 16:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from dave.anglin at bell dot net 2011-11-07 16:11:56 UTC ---
Created attachment 25740
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25740
xxx.c.124t.vrp2


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

* [Bug tree-optimization/50802] [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os
  2011-10-19 23:14 [Bug middle-end/50802] New: [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os danglin at gcc dot gnu.org
                   ` (13 preceding siblings ...)
  2011-11-07 16:20 ` dave.anglin at bell dot net
@ 2011-11-17  2:34 ` danglin at gcc dot gnu.org
  2011-11-18 20:37 ` amylaar at gcc dot gnu.org
                   ` (7 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-11-17  2:34 UTC (permalink / raw)
  To: gcc-bugs

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

John David Anglin <danglin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW


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

* [Bug tree-optimization/50802] [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os
  2011-10-19 23:14 [Bug middle-end/50802] New: [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os danglin at gcc dot gnu.org
                   ` (14 preceding siblings ...)
  2011-11-17  2:34 ` danglin at gcc dot gnu.org
@ 2011-11-18 20:37 ` amylaar at gcc dot gnu.org
  2011-11-18 22:16 ` amylaar at gcc dot gnu.org
                   ` (6 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: amylaar at gcc dot gnu.org @ 2011-11-18 20:37 UTC (permalink / raw)
  To: gcc-bugs

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

Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amylaar at gcc dot gnu.org

--- Comment #13 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> 2011-11-18 20:20:22 UTC ---
(In reply to comment #1)

> The r2 value is wrong.

I see the same problem on Epiphany.
The result of the modulo operation for short int is recycled for signed char.
arith-rand-ll.c.079t.copyrename3 looks OK, but in arith-rand-ll.c.080t.dom1
I see that ill-advised recycling of the modulo result, D.2263_64 in the
below dump snippets:

<bb 27>:
  xx_56 = (short int) x_5;
  # DEBUG xx => xx_56
  yy_57 = (short int) y_6;
  # DEBUG yy => yy_57
  D.2260_58 = (int) x_5;
  D.2261_59 = (int) y_6;
  D.2262_60 = D.2260_58 / D.2261_59;
  # DEBUG r1 => (short int) D.2262_60
  D.2263_64 = D.2260_58 % D.2261_59;
  r2_65 = (short int) D.2263_64;
  # DEBUG r2 => r2_65
  D.2266_66 = (int) r2_65;
  D.2267_67 = ABS_EXPR <D.2266_66>;
  if (yy_57 >= 0)
    goto <bb 28>;
  else
    goto <bb 29>;
...
<bb 31>:
  r1.4_73 = (short unsigned int) D.2262_60;
  yy.3_74 = (short unsigned int) y_6;
  D.2276_75 = r1.4_73 * yy.3_74;
  r2.5_76 = (short unsigned int) D.2263_64;
  D.2278_77 = D.2276_75 + r2.5_76;
  D.2279_78 = (short int) D.2278_77;
  if (D.2279_78 != xx_56)
    goto <bb 32>;
  else
    goto <bb 33>;
...
<bb 37>:
  xx_89 = (signed char) x_5;
  # DEBUG xx => xx_89
  yy_90 = (signed char) y_6;
  # DEBUG yy => yy_90
  D.2291_91 = D.2260_58;
  D.2292_92 = D.2261_59;
  D.2293_93 = D.2262_60;
  # DEBUG r1 => (signed char) D.2262_60
  D.2294_97 = D.2263_64;
  r2_98 = (signed char) D.2263_64;
  # DEBUG r2 => r2_98
  D.2297_99 = (int) r2_98;
  D.2298_100 = ABS_EXPR <D.2297_99>;
  if (yy_90 >= 0)
    goto <bb 38>;
  else
    goto <bb 39>;
...
<bb 41>:
  r1.8_106 = (unsigned char) D.2262_60;
  yy.7_107 = (unsigned char) y_6;
  D.2307_108 = r1.8_106 * yy.7_107;
  r2.9_109 = (unsigned char) D.2263_64;
  D.2309_110 = D.2307_108 + r2.9_109;
  D.2310_111 = (signed char) D.2309_110;
  if (D.2310_111 != xx_89)
    goto <bb 42>;
  else
    goto <bb 43>;


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

* [Bug tree-optimization/50802] [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os
  2011-10-19 23:14 [Bug middle-end/50802] New: [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os danglin at gcc dot gnu.org
                   ` (15 preceding siblings ...)
  2011-11-18 20:37 ` amylaar at gcc dot gnu.org
@ 2011-11-18 22:16 ` amylaar at gcc dot gnu.org
  2011-11-18 22:27 ` amylaar at gcc dot gnu.org
                   ` (5 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: amylaar at gcc dot gnu.org @ 2011-11-18 22:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> 2011-11-18 21:02:01 UTC ---
(In reply to comment #2)
> Introduced by the following change:
> 
> 2011-10-17  Richard Guenther  <rguenther@suse.de>
> 
>     PR tree-optimization/50729
>     * tree-vrp.c (extract_range_from_unary_expr_1): Remove
>     redundant test.
>     (simplify_conversion_using_ranges): Properly test the
>     intermediate result.

I can confirm that backing out this patch makes the arith-rand-ll.c
failure go away on Epiphany.
Backing out only the first hunk doesn't help.
Backing out only the send hunk does.
And, FWIW, LOAD_EXTEND_OP is also ZERO_EXTEND on the Epiphany.


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

* [Bug tree-optimization/50802] [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os
  2011-10-19 23:14 [Bug middle-end/50802] New: [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os danglin at gcc dot gnu.org
                   ` (16 preceding siblings ...)
  2011-11-18 22:16 ` amylaar at gcc dot gnu.org
@ 2011-11-18 22:27 ` amylaar at gcc dot gnu.org
  2011-11-18 22:48 ` amylaar at gcc dot gnu.org
                   ` (4 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: amylaar at gcc dot gnu.org @ 2011-11-18 22:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> 2011-11-18 22:15:29 UTC ---
Created attachment 25855
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25855
Preprocessed testcase for epiphany

I can't reproduce the test on gcc20, I think this is a 32 vs. 64 bit
build and/or host machine issue.

I can reproduce the problem on a 32 bit system:
Linux purzah 3.1.1-1.fc16.i686.PAE #1 SMP Fri Nov 11 22:04:40 UTC 2011 i686
i686 i386 GNU/Linux

I have used trunk revision 181442 .

configured for --target=epiphany-elf .

You don't need Epiphany for this, you can just make "all-gcc", and when
it has configured the gcc build directory, you can stop the build, cd to the
gcc build directory, and build just cc1.

compile the preprocessed sources with:

./cc1 -O2 -dumpbase arith-rand-ll.c arith-rand-ll.i -o arith-rand-ll.s
-fdump-tree-all

in arith-rand-ll.c.080t.dom1, you can see in line 543
  r2_98 = (signed char) D.2263_64

earlier, the same ssa variable has been used in
  r2_65 = (short int) D.2263_64;

both uses are, in fact, incorrect, because D.2263_64 is calculated as 32
bit signed modulo of 32 bit x and y.


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

* [Bug tree-optimization/50802] [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os
  2011-10-19 23:14 [Bug middle-end/50802] New: [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os danglin at gcc dot gnu.org
                   ` (17 preceding siblings ...)
  2011-11-18 22:27 ` amylaar at gcc dot gnu.org
@ 2011-11-18 22:48 ` amylaar at gcc dot gnu.org
  2011-11-19  3:48 ` amylaar at gcc dot gnu.org
                   ` (3 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: amylaar at gcc dot gnu.org @ 2011-11-18 22:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> 2011-11-18 22:45:10 UTC ---
(In reply to comment #15)

I can also replicate this on gcc45 using trunk revision 181496.


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

* [Bug tree-optimization/50802] [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os
  2011-10-19 23:14 [Bug middle-end/50802] New: [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os danglin at gcc dot gnu.org
                   ` (18 preceding siblings ...)
  2011-11-18 22:48 ` amylaar at gcc dot gnu.org
@ 2011-11-19  3:48 ` amylaar at gcc dot gnu.org
  2011-11-21 15:53 ` dave.anglin at bell dot net
                   ` (2 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: amylaar at gcc dot gnu.org @ 2011-11-19  3:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #17 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> 2011-11-19 02:05:05 UTC ---
Created attachment 25857
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25857
Proposed patch

Could you test if this also fixes your regressions?


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

* [Bug tree-optimization/50802] [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os
  2011-10-19 23:14 [Bug middle-end/50802] New: [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os danglin at gcc dot gnu.org
                   ` (19 preceding siblings ...)
  2011-11-19  3:48 ` amylaar at gcc dot gnu.org
@ 2011-11-21 15:53 ` dave.anglin at bell dot net
  2011-12-01 14:27 ` amylaar at gcc dot gnu.org
  2011-12-06 12:05 ` rguenth at gcc dot gnu.org
  22 siblings, 0 replies; 24+ messages in thread
From: dave.anglin at bell dot net @ 2011-11-21 15:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #18 from dave.anglin at bell dot net 2011-11-21 14:59:53 UTC ---
On 11/18/2011 9:05 PM, amylaar at gcc dot gnu.org wrote:
> Could you test if this also fixes your regressions?
It does.

Thanks,
Dave


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

* [Bug tree-optimization/50802] [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os
  2011-10-19 23:14 [Bug middle-end/50802] New: [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os danglin at gcc dot gnu.org
                   ` (20 preceding siblings ...)
  2011-11-21 15:53 ` dave.anglin at bell dot net
@ 2011-12-01 14:27 ` amylaar at gcc dot gnu.org
  2011-12-06 12:05 ` rguenth at gcc dot gnu.org
  22 siblings, 0 replies; 24+ messages in thread
From: amylaar at gcc dot gnu.org @ 2011-12-01 14:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #19 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> 2011-12-01 14:25:52 UTC ---
Author: amylaar
Date: Thu Dec  1 14:25:24 2011
New Revision: 181880

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181880
Log:
        PR tree-optimization/50802
        * tree-vrp.c (simplify_conversion_using_ranges): Rewrite test
        considering what happens to ranges during sign changes and/or
        intermediate narrowing conversions.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-vrp.c


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

* [Bug tree-optimization/50802] [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os
  2011-10-19 23:14 [Bug middle-end/50802] New: [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os danglin at gcc dot gnu.org
                   ` (21 preceding siblings ...)
  2011-12-01 14:27 ` amylaar at gcc dot gnu.org
@ 2011-12-06 12:05 ` rguenth at gcc dot gnu.org
  22 siblings, 0 replies; 24+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-06 12:05 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #20 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-06 12:04:38 UTC ---
Fixed.


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

end of thread, other threads:[~2011-12-06 12:05 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-19 23:14 [Bug middle-end/50802] New: [4.7 Regression] FAIL: gcc.c-torture/execute/arith-rand-ll.c execution at -O2 and -Os danglin at gcc dot gnu.org
2011-10-20  9:01 ` [Bug middle-end/50802] " rguenth at gcc dot gnu.org
2011-10-23 19:54 ` danglin at gcc dot gnu.org
2011-10-24  0:02 ` [Bug tree-optimization/50802] " danglin at gcc dot gnu.org
2011-10-27 11:21 ` rguenth at gcc dot gnu.org
2011-10-27 11:50 ` dave.anglin at bell dot net
2011-10-30 20:00 ` danglin at gcc dot gnu.org
2011-11-07  1:05 ` danglin at gcc dot gnu.org
2011-11-07 11:07 ` rguenth at gcc dot gnu.org
2011-11-07 12:49 ` dave.anglin at bell dot net
2011-11-07 14:46 ` dave.anglin at bell dot net
2011-11-07 14:47 ` dave.anglin at bell dot net
2011-11-07 15:21 ` rguenth at gcc dot gnu.org
2011-11-07 16:15 ` dave.anglin at bell dot net
2011-11-07 16:20 ` dave.anglin at bell dot net
2011-11-17  2:34 ` danglin at gcc dot gnu.org
2011-11-18 20:37 ` amylaar at gcc dot gnu.org
2011-11-18 22:16 ` amylaar at gcc dot gnu.org
2011-11-18 22:27 ` amylaar at gcc dot gnu.org
2011-11-18 22:48 ` amylaar at gcc dot gnu.org
2011-11-19  3:48 ` amylaar at gcc dot gnu.org
2011-11-21 15:53 ` dave.anglin at bell dot net
2011-12-01 14:27 ` amylaar at gcc dot gnu.org
2011-12-06 12:05 ` rguenth 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).