public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/42074]  New: gcc.dg/torture/builtin-math-7.c failed
@ 2009-11-17  0:20 hjl dot tools at gmail dot com
  2009-11-17  1:47 ` [Bug lto/42074] " paolo dot carlini at oracle dot com
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-11-17  0:20 UTC (permalink / raw)
  To: gcc-bugs

I installed MPC 0.8 on Linux/ia32 and Linux/x86-64. With revision
154212, I got

FAIL: gcc.dg/torture/builtin-math-7.c  -O2 -flto  execution test
FAIL: gcc.dg/torture/builtin-math-7.c  -O2 -fwhopr  execution test


-- 
           Summary: gcc.dg/torture/builtin-math-7.c failed
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        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=42074


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

* [Bug lto/42074] gcc.dg/torture/builtin-math-7.c failed
  2009-11-17  0:20 [Bug lto/42074] New: gcc.dg/torture/builtin-math-7.c failed hjl dot tools at gmail dot com
@ 2009-11-17  1:47 ` paolo dot carlini at oracle dot com
  2009-11-17  3:56 ` howarth at nitro dot med dot uc dot edu
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-11-17  1:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from paolo dot carlini at oracle dot com  2009-11-17 01:47 -------
I'm also seeing this.


-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-11-17 01:47:17
               date|                            |


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


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

* [Bug lto/42074] gcc.dg/torture/builtin-math-7.c failed
  2009-11-17  0:20 [Bug lto/42074] New: gcc.dg/torture/builtin-math-7.c failed hjl dot tools at gmail dot com
  2009-11-17  1:47 ` [Bug lto/42074] " paolo dot carlini at oracle dot com
@ 2009-11-17  3:56 ` howarth at nitro dot med dot uc dot edu
  2009-12-07 16:55 ` howarth at nitro dot med dot uc dot edu
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2009-11-17  3:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from howarth at nitro dot med dot uc dot edu  2009-11-17 03:56 -------
On x86_64-apple-darwin10 with MPC 0.8, we are getting...

FAIL: gcc.dg/torture/builtin-math-7.c  -O0  execution test
FAIL: gcc.dg/torture/builtin-math-7.c  -O1  execution test
FAIL: gcc.dg/torture/builtin-math-7.c  -O2  execution test
FAIL: gcc.dg/torture/builtin-math-7.c  -O3 -fomit-frame-pointer  execution test
FAIL: gcc.dg/torture/builtin-math-7.c  -O3 -fomit-frame-pointer -funroll-loops 
execution test
FAIL: gcc.dg/torture/builtin-math-7.c  -O3 -fomit-frame-pointer
-funroll-all-loops -finline-functions  execution test
FAIL: gcc.dg/torture/builtin-math-7.c  -O3 -g  execution test
FAIL: gcc.dg/torture/builtin-math-7.c  -Os  execution test

in r154232.


-- 


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


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

* [Bug lto/42074] gcc.dg/torture/builtin-math-7.c failed
  2009-11-17  0:20 [Bug lto/42074] New: gcc.dg/torture/builtin-math-7.c failed hjl dot tools at gmail dot com
  2009-11-17  1:47 ` [Bug lto/42074] " paolo dot carlini at oracle dot com
  2009-11-17  3:56 ` howarth at nitro dot med dot uc dot edu
@ 2009-12-07 16:55 ` howarth at nitro dot med dot uc dot edu
  2009-12-08  0:34 ` howarth at nitro dot med dot uc dot edu
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2009-12-07 16:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from howarth at nitro dot med dot uc dot edu  2009-12-07 16:54 -------
Oddly these errors don't show up on x86_64-apple-darwin9 built with mpc 0.8.


-- 


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


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

* [Bug lto/42074] gcc.dg/torture/builtin-math-7.c failed
  2009-11-17  0:20 [Bug lto/42074] New: gcc.dg/torture/builtin-math-7.c failed hjl dot tools at gmail dot com
                   ` (2 preceding siblings ...)
  2009-12-07 16:55 ` howarth at nitro dot med dot uc dot edu
@ 2009-12-08  0:34 ` howarth at nitro dot med dot uc dot edu
  2009-12-08  0:35 ` howarth at nitro dot med dot uc dot edu
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2009-12-08  0:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from howarth at nitro dot med dot uc dot edu  2009-12-08 00:34 -------
On x86_64-apple-darwin10, the section of the test case that is failing is...

  /* Test that we don't overflow.  */
  TESTIT (double,
          (__DBL_MAX__ * 0.5 + __DBL_MAX__ * 0.5i),
          /,
          (__DBL_MAX__ * 0.25 + __DBL_MAX__ * 0.25i),
          2); 

The remainder of the test case passes at all optimization settings.


-- 


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


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

* [Bug lto/42074] gcc.dg/torture/builtin-math-7.c failed
  2009-11-17  0:20 [Bug lto/42074] New: gcc.dg/torture/builtin-math-7.c failed hjl dot tools at gmail dot com
                   ` (3 preceding siblings ...)
  2009-12-08  0:34 ` howarth at nitro dot med dot uc dot edu
@ 2009-12-08  0:35 ` howarth at nitro dot med dot uc dot edu
  2009-12-08  0:36 ` howarth at nitro dot med dot uc dot edu
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2009-12-08  0:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from howarth at nitro dot med dot uc dot edu  2009-12-08 00:35 -------
Created an attachment (id=19254)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19254&action=view)
preprocessed source of reduced builtin-math-7 test case on
x86_64-apple-darwin10


-- 


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


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

* [Bug lto/42074] gcc.dg/torture/builtin-math-7.c failed
  2009-11-17  0:20 [Bug lto/42074] New: gcc.dg/torture/builtin-math-7.c failed hjl dot tools at gmail dot com
                   ` (4 preceding siblings ...)
  2009-12-08  0:35 ` howarth at nitro dot med dot uc dot edu
@ 2009-12-08  0:36 ` howarth at nitro dot med dot uc dot edu
  2009-12-08  6:10 ` ghazi at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2009-12-08  0:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from howarth at nitro dot med dot uc dot edu  2009-12-08 00:36 -------
Created an attachment (id=19255)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19255&action=view)
assembly of reduced builtin-math-7 test case on x86_64-apple-darwin10 compiled
at -O0.


-- 


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


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

* [Bug lto/42074] gcc.dg/torture/builtin-math-7.c failed
  2009-11-17  0:20 [Bug lto/42074] New: gcc.dg/torture/builtin-math-7.c failed hjl dot tools at gmail dot com
                   ` (5 preceding siblings ...)
  2009-12-08  0:36 ` howarth at nitro dot med dot uc dot edu
@ 2009-12-08  6:10 ` ghazi at gcc dot gnu dot org
  2009-12-08  7:19 ` ghazi at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2009-12-08  6:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from ghazi at gcc dot gnu dot org  2009-12-08 06:10 -------
I took a quick look.  First, there seems to be two separate bugs reported here.
 One bug, reported by HJ, appears to be lto/whopr related, and so happens on
systems lto is activated.  The other bug is specific to Darwin (10 only?) and
happens at all optimizations levels without lto.  Jack reported the Darwin
errors happen on the DBL_MAX overflow check.  I ran the testcase with lto and
it failed in the TEST_ONE_PART_INF section.  The two different errors may have
the same root cause, or not in which case a separate PR should be opened for
the Darwin error.

The second comment I have is that all of these are runtime/execute failures. 
That means it's not related to MPC per se which only handles compile-time
optimizations.  In addition to the compile-time checks, the testcase sanity
checks the runtime behavior of GCC and that's what's failing.


-- 

ghazi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|ghazi at caip dot rutgers   |ghazi at gcc dot gnu dot org
                   |dot edu                     |
   Last reconfirmed|2009-11-17 01:47:17         |2009-12-08 06:10:08
               date|                            |


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


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

* [Bug lto/42074] gcc.dg/torture/builtin-math-7.c failed
  2009-11-17  0:20 [Bug lto/42074] New: gcc.dg/torture/builtin-math-7.c failed hjl dot tools at gmail dot com
                   ` (6 preceding siblings ...)
  2009-12-08  6:10 ` ghazi at gcc dot gnu dot org
@ 2009-12-08  7:19 ` ghazi at gcc dot gnu dot org
  2009-12-08  8:08 ` ghazi at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2009-12-08  7:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from ghazi at gcc dot gnu dot org  2009-12-08 07:18 -------
Here's a reduced testcase for the -flto/-fwhopr failures.  If you compile it
with "-O2 -flto" or "-O2 -fwhopr" you get the wrong answers:
nan nan
nan nan

If you use just -O2, you get the correct output, i.e. it contains an inf:
-inf nan
inf nan

It seems like the erroneous case occurs with the wrong value for
flag_complex_method during code-gen.  Although how/why that happens I can't
say.  I think someone more familiar with LTO should look as this part.



#define VAL ((_Complex double)__builtin_inf() * 1i)
#define PRINTIT(X) do { \
  __builtin_printf ("%g %g\n", __real (X), __imag (X)); \
} while (0)

int main(void)
{
  PRINTIT(VAL * VAL);
  PRINTIT((_Complex double) 1 / (_Complex double) 0);
  return 0;
}


-- 


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


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

* [Bug lto/42074] gcc.dg/torture/builtin-math-7.c failed
  2009-11-17  0:20 [Bug lto/42074] New: gcc.dg/torture/builtin-math-7.c failed hjl dot tools at gmail dot com
                   ` (7 preceding siblings ...)
  2009-12-08  7:19 ` ghazi at gcc dot gnu dot org
@ 2009-12-08  8:08 ` ghazi at gcc dot gnu dot org
  2009-12-08  9:56 ` dominiq at lps dot ens dot fr
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2009-12-08  8:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from ghazi at gcc dot gnu dot org  2009-12-08 08:08 -------
Jack, what does this program do on darwin9 and darwin10?
(The correct output is "2 0".)

int main(void)
{
  volatile _Complex double val = (__DBL_MAX__ * 0.5 + __DBL_MAX__ * 0.5i);
  val /= (__DBL_MAX__ * 0.25 + __DBL_MAX__ * 0.25i);
  __builtin_printf ("%g %g\n", __real (val), __imag (val));
  if (val != 2) __builtin_abort();
  return 0;
}


-- 


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


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

* [Bug lto/42074] gcc.dg/torture/builtin-math-7.c failed
  2009-11-17  0:20 [Bug lto/42074] New: gcc.dg/torture/builtin-math-7.c failed hjl dot tools at gmail dot com
                   ` (8 preceding siblings ...)
  2009-12-08  8:08 ` ghazi at gcc dot gnu dot org
@ 2009-12-08  9:56 ` dominiq at lps dot ens dot fr
  2009-12-08 16:36 ` [Bug lto/42074] gcc.dg/torture/builtin-math-7.c fails with -flto or -fwhopr ghazi at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: dominiq at lps dot ens dot fr @ 2009-12-08  9:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from dominiq at lps dot ens dot fr  2009-12-08 09:56 -------
I had a look at the problem and found that it is due to the -lm flag used in
the test suite. The test in comment #9 gives for x86_64-apple-darwin10:

[macbook] f90/bug% a.out 
2 0
[macbook] f90/bug% gcc45 pr42074.c -lm
[macbook] f90/bug% a.out
inf 0
Abort

and tgcc.dg/torture/builtin-math-7.c passes when it is compiled manually
without -lm.

Note that gcc version 4.4.2 (GCC) gives the same results, but not gcc version
4.2.1 (Apple Inc. build 5646) (dot 1) Target: i686-apple-darwin10:

[macbook] f90/bug% gcc pr42074.c -lm
[macbook] f90/bug% a.out
2 0

These tests pass on powerpc-apple-darwin9 with gcc4.5 rev.155054.

I don't have access right now to *86*-apple-darwin9 and older versions of gcc,
but I'll check on it tonight.


-- 


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


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

* [Bug lto/42074] gcc.dg/torture/builtin-math-7.c fails with -flto or -fwhopr
  2009-11-17  0:20 [Bug lto/42074] New: gcc.dg/torture/builtin-math-7.c failed hjl dot tools at gmail dot com
                   ` (9 preceding siblings ...)
  2009-12-08  9:56 ` dominiq at lps dot ens dot fr
@ 2009-12-08 16:36 ` ghazi at gcc dot gnu dot org
  2009-12-11 11:46 ` [Bug target/42074] gcc.dg/torture/builtin-math-7.c fails on darwin rguenth at gcc dot gnu dot org
  2009-12-11 16:44 ` ghazi at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2009-12-08 16:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from ghazi at gcc dot gnu dot org  2009-12-08 16:35 -------
(In reply to comment #10)
> I had a look at the problem and found that it is due to the -lm flag used in
> the test suite. [...]
> and tgcc.dg/torture/builtin-math-7.c passes when it is compiled manually
> without -lm.

Thanks.  Clearly now these are separate bugs.  I've opened PR42333 for the
darwin10 issue.  Let's continue the discussion about that problem in that PR.

This PR will remain solely for the -flto/-fwhopr failures.  I've modified the
description accordingly.  Someone who understands LTO needs to investigate the
code from comment#8.


-- 

ghazi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|gcc.dg/torture/builtin-math-|gcc.dg/torture/builtin-math-
                   |7.c failed                  |7.c fails with -flto or -
                   |                            |fwhopr


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


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

* [Bug target/42074] gcc.dg/torture/builtin-math-7.c fails on darwin
  2009-11-17  0:20 [Bug lto/42074] New: gcc.dg/torture/builtin-math-7.c failed hjl dot tools at gmail dot com
                   ` (10 preceding siblings ...)
  2009-12-08 16:36 ` [Bug lto/42074] gcc.dg/torture/builtin-math-7.c fails with -flto or -fwhopr ghazi at gcc dot gnu dot org
@ 2009-12-11 11:46 ` rguenth at gcc dot gnu dot org
  2009-12-11 16:44 ` ghazi at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-12-11 11:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from rguenth at gcc dot gnu dot org  2009-12-11 11:46 -------
This is now darwin specific, the lto issue is PR41915.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|lto                         |target
 GCC target triplet|                            |x86_64-apple-darwin10
            Summary|gcc.dg/torture/builtin-math-|gcc.dg/torture/builtin-math-
                   |7.c fails with -flto or -   |7.c fails on darwin
                   |fwhopr                      |


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


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

* [Bug target/42074] gcc.dg/torture/builtin-math-7.c fails on darwin
  2009-11-17  0:20 [Bug lto/42074] New: gcc.dg/torture/builtin-math-7.c failed hjl dot tools at gmail dot com
                   ` (11 preceding siblings ...)
  2009-12-11 11:46 ` [Bug target/42074] gcc.dg/torture/builtin-math-7.c fails on darwin rguenth at gcc dot gnu dot org
@ 2009-12-11 16:44 ` ghazi at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2009-12-11 16:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from ghazi at gcc dot gnu dot org  2009-12-11 16:44 -------
The Darwin issue is being tracked in PR42333.  Since the LTO issue is fixed, to
avoid confusion I'll close this one as a dup.


*** This bug has been marked as a duplicate of 42333 ***


-- 

ghazi at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2009-12-11 16:44 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-17  0:20 [Bug lto/42074] New: gcc.dg/torture/builtin-math-7.c failed hjl dot tools at gmail dot com
2009-11-17  1:47 ` [Bug lto/42074] " paolo dot carlini at oracle dot com
2009-11-17  3:56 ` howarth at nitro dot med dot uc dot edu
2009-12-07 16:55 ` howarth at nitro dot med dot uc dot edu
2009-12-08  0:34 ` howarth at nitro dot med dot uc dot edu
2009-12-08  0:35 ` howarth at nitro dot med dot uc dot edu
2009-12-08  0:36 ` howarth at nitro dot med dot uc dot edu
2009-12-08  6:10 ` ghazi at gcc dot gnu dot org
2009-12-08  7:19 ` ghazi at gcc dot gnu dot org
2009-12-08  8:08 ` ghazi at gcc dot gnu dot org
2009-12-08  9:56 ` dominiq at lps dot ens dot fr
2009-12-08 16:36 ` [Bug lto/42074] gcc.dg/torture/builtin-math-7.c fails with -flto or -fwhopr ghazi at gcc dot gnu dot org
2009-12-11 11:46 ` [Bug target/42074] gcc.dg/torture/builtin-math-7.c fails on darwin rguenth at gcc dot gnu dot org
2009-12-11 16:44 ` ghazi 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).