public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/41963]  New: [4.5 Regression] 177.mesa in SPEC CPU 2K is miscompiled
@ 2009-11-06  5:13 hjl dot tools at gmail dot com
  2009-11-06  7:40 ` [Bug middle-end/41963] " ubizjak at gmail dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-11-06  5:13 UTC (permalink / raw)
  To: gcc-bugs

On Linux/x86-64, 177.mesa in SPEC CPU 2K is miscompiled at -O3 -ffast-math
by revision 153946:

  Running 177.mesa ref base o3 default
*** Miscompare of mesa.ppm, see
/export/gnu/import/svn/gcc-test/spec/2000/x86_64
/spec/benchspec/CFP2000/177.mesa/run/00000002/mesa.ppm.mis

Revision 153929 is OK.


-- 
           Summary: [4.5 Regression] 177.mesa in SPEC CPU 2K is miscompiled
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hjl dot tools at gmail dot com


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


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

* [Bug middle-end/41963] [4.5 Regression] 177.mesa in SPEC CPU 2K is miscompiled
  2009-11-06  5:13 [Bug middle-end/41963] New: [4.5 Regression] 177.mesa in SPEC CPU 2K is miscompiled hjl dot tools at gmail dot com
@ 2009-11-06  7:40 ` ubizjak at gmail dot com
  2009-11-06 10:10 ` rguenth at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ubizjak at gmail dot com @ 2009-11-06  7:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from ubizjak at gmail dot com  2009-11-06 07:40 -------
I can't confirm this, but perhaps due to r153940:

        * config/i386/i386.c (ix86_builtin_reciprocal): Remove dependency
        on TARGET_RECIP.
        * doc/invoke.texi (-mrecip): Clarify that we don't need -mrecip
        for 1/sqrtf.


-- 

ubizjak at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |matz at gcc dot gnu dot org


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


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

* [Bug middle-end/41963] [4.5 Regression] 177.mesa in SPEC CPU 2K is miscompiled
  2009-11-06  5:13 [Bug middle-end/41963] New: [4.5 Regression] 177.mesa in SPEC CPU 2K is miscompiled hjl dot tools at gmail dot com
  2009-11-06  7:40 ` [Bug middle-end/41963] " ubizjak at gmail dot com
@ 2009-11-06 10:10 ` rguenth at gcc dot gnu dot org
  2009-11-06 12:03 ` matz at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-11-06 10:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2009-11-06 10:10 -------
Confirmed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-11-06 10:10:10
               date|                            |
   Target Milestone|---                         |4.5.0


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


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

* [Bug middle-end/41963] [4.5 Regression] 177.mesa in SPEC CPU 2K is miscompiled
  2009-11-06  5:13 [Bug middle-end/41963] New: [4.5 Regression] 177.mesa in SPEC CPU 2K is miscompiled hjl dot tools at gmail dot com
  2009-11-06  7:40 ` [Bug middle-end/41963] " ubizjak at gmail dot com
  2009-11-06 10:10 ` rguenth at gcc dot gnu dot org
@ 2009-11-06 12:03 ` matz at gcc dot gnu dot org
  2009-11-06 13:07 ` matz at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: matz at gcc dot gnu dot org @ 2009-11-06 12:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from matz at gcc dot gnu dot org  2009-11-06 12:03 -------
Yes, it's indeed my patch.  I'm working on it.


-- 

matz at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |matz at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2009-11-06 10:10:10         |2009-11-06 12:03:45
               date|                            |


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


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

* [Bug middle-end/41963] [4.5 Regression] 177.mesa in SPEC CPU 2K is miscompiled
  2009-11-06  5:13 [Bug middle-end/41963] New: [4.5 Regression] 177.mesa in SPEC CPU 2K is miscompiled hjl dot tools at gmail dot com
                   ` (2 preceding siblings ...)
  2009-11-06 12:03 ` matz at gcc dot gnu dot org
@ 2009-11-06 13:07 ` matz at gcc dot gnu dot org
  2009-11-06 15:05 ` matz at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: matz at gcc dot gnu dot org @ 2009-11-06 13:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from matz at gcc dot gnu dot org  2009-11-06 13:07 -------
It's a simple miscompilation of the cse_reciprocals pass that is exposed
by my change:

% cat pr41963.c
#include <math.h>

static __attribute__((noinline)) void f (float *dst, float *src)
{
  int i, j;
  for (i = 0; i < 2; i++)
    {
      float len;
      dst[0] = src[0];
      dst[1] = src[1];
      len = sqrtf (dst[0] * dst[0] + dst[1] * dst[1]);
      if (len > 0.5f)
        {
          len = 1.0f / len;
          dst[0] *= len;
          dst[1] *= len;
        }
    }
}

int main()
{
  float dst[2], src[2];
  src[0] = 2.0f;
  src[1] = 5.0f;
  f (dst, src);
  printf ("%f %f -> %f\n", dst[0], dst[1], dst[0] * dst[0] + dst[1] * dst[1]);
  return 0;
}

The reciprocal pass overwrites the statement
  len = sqrtf(temp)
  (and a later use of len in 1/len)
with
  len = rsqrtf(temp)
  (and removed the 1/len computation)
But it does this without caring for _any_ other use of len, e.g. in the
compare or the second loop iteration.


-- 


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


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

* [Bug middle-end/41963] [4.5 Regression] 177.mesa in SPEC CPU 2K is miscompiled
  2009-11-06  5:13 [Bug middle-end/41963] New: [4.5 Regression] 177.mesa in SPEC CPU 2K is miscompiled hjl dot tools at gmail dot com
                   ` (3 preceding siblings ...)
  2009-11-06 13:07 ` matz at gcc dot gnu dot org
@ 2009-11-06 15:05 ` matz at gcc dot gnu dot org
  2009-11-06 15:15 ` matz at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: matz at gcc dot gnu dot org @ 2009-11-06 15:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from matz at gcc dot gnu dot org  2009-11-06 15:05 -------
Subject: Bug 41963

Author: matz
Date: Fri Nov  6 15:05:20 2009
New Revision: 153971

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153971
Log:
        PR middle-end/41963
        * tree-ssa-math-opts.c (execute_cse_reciprocals): Check all uses
        of a potential reciprocal to really be reciprocals.

testsuite/
        * gcc.dg/pr41963.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr41963.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-math-opts.c


-- 


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


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

* [Bug middle-end/41963] [4.5 Regression] 177.mesa in SPEC CPU 2K is miscompiled
  2009-11-06  5:13 [Bug middle-end/41963] New: [4.5 Regression] 177.mesa in SPEC CPU 2K is miscompiled hjl dot tools at gmail dot com
                   ` (4 preceding siblings ...)
  2009-11-06 15:05 ` matz at gcc dot gnu dot org
@ 2009-11-06 15:15 ` matz at gcc dot gnu dot org
  2009-11-06 21:54 ` ubizjak at gmail dot com
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: matz at gcc dot gnu dot org @ 2009-11-06 15:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from matz at gcc dot gnu dot org  2009-11-06 15:14 -------
Fixed.


-- 

matz at gcc dot gnu dot org changed:

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


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


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

* [Bug middle-end/41963] [4.5 Regression] 177.mesa in SPEC CPU 2K is miscompiled
  2009-11-06  5:13 [Bug middle-end/41963] New: [4.5 Regression] 177.mesa in SPEC CPU 2K is miscompiled hjl dot tools at gmail dot com
                   ` (6 preceding siblings ...)
  2009-11-06 21:54 ` ubizjak at gmail dot com
@ 2009-11-06 21:54 ` ubizjak at gmail dot com
  2009-11-08 18:10 ` uros at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ubizjak at gmail dot com @ 2009-11-06 21:54 UTC (permalink / raw)
  To: gcc-bugs



-- 

ubizjak at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|matz at gcc dot gnu dot org |ubizjak at gmail dot com
             Status|REOPENED                    |ASSIGNED
   Last reconfirmed|2009-11-06 12:03:45         |2009-11-06 21:54:37
               date|                            |


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


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

* [Bug middle-end/41963] [4.5 Regression] 177.mesa in SPEC CPU 2K is miscompiled
  2009-11-06  5:13 [Bug middle-end/41963] New: [4.5 Regression] 177.mesa in SPEC CPU 2K is miscompiled hjl dot tools at gmail dot com
                   ` (5 preceding siblings ...)
  2009-11-06 15:15 ` matz at gcc dot gnu dot org
@ 2009-11-06 21:54 ` ubizjak at gmail dot com
  2009-11-06 21:54 ` ubizjak at gmail dot com
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ubizjak at gmail dot com @ 2009-11-06 21:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from ubizjak at gmail dot com  2009-11-06 21:54 -------
The same problem exists in 4.3 and 4.4.

I will backport the patch.


-- 

ubizjak at gmail dot com changed:

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


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


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

* [Bug middle-end/41963] [4.5 Regression] 177.mesa in SPEC CPU 2K is miscompiled
  2009-11-06  5:13 [Bug middle-end/41963] New: [4.5 Regression] 177.mesa in SPEC CPU 2K is miscompiled hjl dot tools at gmail dot com
                   ` (7 preceding siblings ...)
  2009-11-06 21:54 ` ubizjak at gmail dot com
@ 2009-11-08 18:10 ` uros at gcc dot gnu dot org
  2009-11-09 13:07 ` rguenth at gcc dot gnu dot org
  2009-11-09 19:45 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: uros at gcc dot gnu dot org @ 2009-11-08 18:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from uros at gcc dot gnu dot org  2009-11-08 18:10 -------
Subject: Bug 41963

Author: uros
Date: Sun Nov  8 18:10:10 2009
New Revision: 154011

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154011
Log:
        Backport from mainline:
        2009-11-06  Michael Matz  <matz@suse.de>

        PR middle-end/41963
        * tree-ssa-math-opts.c (execute_cse_reciprocals): Check all uses
        of a potential reciprocal to really be reciprocals.

testsuite/ChangeLog:

        Backport from mainline:
        2009-11-06  Michael Matz  <matz@suse.de>

        PR middle-end/41963
        * gcc.target/i386/pr41963.c: New test.


Added:
    branches/gcc-4_4-branch/gcc/testsuite/gcc.target/i386/pr41963.c
Modified:
    branches/gcc-4_4-branch/gcc/ChangeLog
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_4-branch/gcc/tree-ssa-math-opts.c


-- 


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


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

* [Bug middle-end/41963] [4.5 Regression] 177.mesa in SPEC CPU 2K is miscompiled
  2009-11-06  5:13 [Bug middle-end/41963] New: [4.5 Regression] 177.mesa in SPEC CPU 2K is miscompiled hjl dot tools at gmail dot com
                   ` (8 preceding siblings ...)
  2009-11-08 18:10 ` uros at gcc dot gnu dot org
@ 2009-11-09 13:07 ` rguenth at gcc dot gnu dot org
  2009-11-09 19:45 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-11-09 13:07 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

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


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


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

* [Bug middle-end/41963] [4.5 Regression] 177.mesa in SPEC CPU 2K is miscompiled
  2009-11-06  5:13 [Bug middle-end/41963] New: [4.5 Regression] 177.mesa in SPEC CPU 2K is miscompiled hjl dot tools at gmail dot com
                   ` (9 preceding siblings ...)
  2009-11-09 13:07 ` rguenth at gcc dot gnu dot org
@ 2009-11-09 19:45 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-11-09 19:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from pinskia at gcc dot gnu dot org  2009-11-09 19:45 -------
Fixed so closing.


-- 

pinskia at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2009-11-09 19:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-06  5:13 [Bug middle-end/41963] New: [4.5 Regression] 177.mesa in SPEC CPU 2K is miscompiled hjl dot tools at gmail dot com
2009-11-06  7:40 ` [Bug middle-end/41963] " ubizjak at gmail dot com
2009-11-06 10:10 ` rguenth at gcc dot gnu dot org
2009-11-06 12:03 ` matz at gcc dot gnu dot org
2009-11-06 13:07 ` matz at gcc dot gnu dot org
2009-11-06 15:05 ` matz at gcc dot gnu dot org
2009-11-06 15:15 ` matz at gcc dot gnu dot org
2009-11-06 21:54 ` ubizjak at gmail dot com
2009-11-06 21:54 ` ubizjak at gmail dot com
2009-11-08 18:10 ` uros at gcc dot gnu dot org
2009-11-09 13:07 ` rguenth at gcc dot gnu dot org
2009-11-09 19:45 ` 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).