public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/31394] cos() returns wrong value unless -O0 is used
       [not found] <bug-31394-4@http.gcc.gnu.org/bugzilla/>
@ 2012-01-19  5:16 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-01-19  5:16 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-01-19 05:01:17 UTC ---
This is a bug in Solaris's libc where sincos does not produce the same results
as sin() and cos() separately would.


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

* [Bug target/31394] cos() returns wrong value unless -O0 is used
  2007-03-29 16:54 [Bug c/31394] New: " sdirkse at gams dot com
  2007-03-29 17:50 ` [Bug target/31394] " dominiq at lps dot ens dot fr
  2007-03-30 20:36 ` sdirkse at gams dot com
@ 2007-03-30 20:56 ` dominiq at lps dot ens dot fr
  2 siblings, 0 replies; 4+ messages in thread
From: dominiq at lps dot ens dot fr @ 2007-03-30 20:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from dominiq at lps dot ens dot fr  2007-03-30 21:56 -------
> I suppose that makes it a duplicate of PR30980.

It would have been better to check it directly before updating.  PR30980 was
related to g++ and gfortran and not gcc, so it seems that your platform
(i386-pc-solaris2.10?) differs from Darwin at least.

Now, could you please time the C test of PR31249, with and without -O and
report what you get:

#include <math.h>
#include <stdio.h>

int main()
{

  long    n = 1000000;
  long    i;
  double mo = -1.0;
  double pi = acos(mo);
  double sc = 0.0;
  double ss = 0.0;
  double  t = 0.0;
  double dt = pi/n;

  printf("%.17g \n", pi);
  printf("%.17g \n", dt);
  for (i=0; i< 40*n; i++) {
    sc += cos(t);
    ss += sin(t);
    t += dt;
  }
  printf("%.17g %.17g \n", sc, ss);
}

It will take less than a couple of minutes and see if -O is a real optimization
or not on your platform.
TIA


-- 


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


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

* [Bug target/31394] cos() returns wrong value unless -O0 is used
  2007-03-29 16:54 [Bug c/31394] New: " sdirkse at gams dot com
  2007-03-29 17:50 ` [Bug target/31394] " dominiq at lps dot ens dot fr
@ 2007-03-30 20:36 ` sdirkse at gams dot com
  2007-03-30 20:56 ` dominiq at lps dot ens dot fr
  2 siblings, 0 replies; 4+ messages in thread
From: sdirkse at gams dot com @ 2007-03-30 20:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from sdirkse at gams dot com  2007-03-30 21:36 -------
I installed gcc 20070329 and the problem I was having is solved.  I suppose
that makes it a duplicate of PR30980.


-- 


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


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

* [Bug target/31394] cos() returns wrong value unless -O0 is used
  2007-03-29 16:54 [Bug c/31394] New: " sdirkse at gams dot com
@ 2007-03-29 17:50 ` dominiq at lps dot ens dot fr
  2007-03-30 20:36 ` sdirkse at gams dot com
  2007-03-30 20:56 ` dominiq at lps dot ens dot fr
  2 siblings, 0 replies; 4+ messages in thread
From: dominiq at lps dot ens dot fr @ 2007-03-29 17:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from dominiq at lps dot ens dot fr  2007-03-29 18:50 -------
This bug reminds me PR30980 and PR31161, though they were reported only for g++
and gfortran (they were fixed on 2007-03-16). Could you look at them to see if
the bug you have reported is not a duplicate? If yes, you should update your
build.

Could you be also kind enough to look at the related optimization problem
PR31249 and see it affects also your platform?


-- 


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


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

end of thread, other threads:[~2012-01-19  5:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-31394-4@http.gcc.gnu.org/bugzilla/>
2012-01-19  5:16 ` [Bug target/31394] cos() returns wrong value unless -O0 is used pinskia at gcc dot gnu.org
2007-03-29 16:54 [Bug c/31394] New: " sdirkse at gams dot com
2007-03-29 17:50 ` [Bug target/31394] " dominiq at lps dot ens dot fr
2007-03-30 20:36 ` sdirkse at gams dot com
2007-03-30 20:56 ` dominiq at lps dot ens dot fr

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).