[Bug fortran/44448] 32-bit gfortran.dg/atan2_1.f90 fails on Solaris 1[01]/x86 at -O0

2010-06-25 Thread ro at CeBiTec dot Uni-Bielefeld dot DE


--- Comment #10 from ro at CeBiTec dot Uni-Bielefeld dot DE  2010-06-25 
16:49 ---
Subject: Re:  32-bit gfortran.dg/atan2_1.f90 fails on Solaris 1[01]/x86 at -O0

 --- Comment #8 from jvdelisle at gcc dot gnu dot org  2010-06-22 01:24 
 ---
 atan2_1.f90 has failed on other platforms before too.  I think we just need:

  ! { dg-options -ffloat-store }

 or maybe this

  ! { dg-options -O0 -ffloat-store }

 in the test file.  Can you try that and see if it clears your problem. Add it
 right after the line that says ! { dg-do run }

 The first variant works like a charm: this way, we still iterate over
 several optimization levels, which would be defeated by the second one.

How should we proceed from here?  Should I formally propose the patch
above?

Rainer


-- 


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



[Bug fortran/44448] 32-bit gfortran.dg/atan2_1.f90 fails on Solaris 1[01]/x86 at -O0

2010-06-25 Thread jvdelisle at gcc dot gnu dot org


--- Comment #11 from jvdelisle at gcc dot gnu dot org  2010-06-25 18:22 
---
Please go ahead and commit, OK by me.


-- 


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



[Bug fortran/44448] 32-bit gfortran.dg/atan2_1.f90 fails on Solaris 1[01]/x86 at -O0

2010-06-25 Thread ro at gcc dot gnu dot org


--- Comment #12 from ro at gcc dot gnu dot org  2010-06-25 18:32 ---
Subject: Bug 8

Author: ro
Date: Fri Jun 25 18:31:33 2010
New Revision: 161392

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=161392
Log:
2010-06-25  Jerry DeLisle  jvdeli...@gcc.gnu.org

PR fortran/8
* gfortran.dg/atan2_1.f90: Add -ffloat-store.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/atan2_1.f90


-- 


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



[Bug fortran/44448] 32-bit gfortran.dg/atan2_1.f90 fails on Solaris 1[01]/x86 at -O0

2010-06-25 Thread ro at gcc dot gnu dot org


--- Comment #13 from ro at gcc dot gnu dot org  2010-06-25 18:33 ---
Subject: Bug 8

Author: ro
Date: Fri Jun 25 18:33:01 2010
New Revision: 161393

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=161393
Log:
2010-06-25  Jerry DeLisle  jvdeli...@gcc.gnu.org

PR fortran/8
* gfortran.dg/atan2_1.f90: Add -ffloat-store.

Modified:
branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
branches/gcc-4_5-branch/gcc/testsuite/gfortran.dg/atan2_1.f90


-- 


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



[Bug fortran/44448] 32-bit gfortran.dg/atan2_1.f90 fails on Solaris 1[01]/x86 at -O0

2010-06-25 Thread ro at gcc dot gnu dot org


--- Comment #14 from ro at gcc dot gnu dot org  2010-06-25 18:36 ---
Thanks, installed on mainline and 4.5 branch.


-- 

ro at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
  Known to fail|4.5.1 4.6.0 |
  Known to work||4.5.1 4.6.0
 Resolution||FIXED
   Target Milestone|--- |4.5.1


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



[Bug fortran/44448] 32-bit gfortran.dg/atan2_1.f90 fails on Solaris 1[01]/x86 at -O0

2010-06-22 Thread ro at CeBiTec dot Uni-Bielefeld dot DE


--- Comment #9 from ro at CeBiTec dot Uni-Bielefeld dot DE  2010-06-22 
15:42 ---
Subject: Re:  32-bit gfortran.dg/atan2_1.f90 fails on Solaris 1[01]/x86 at -O0

 --- Comment #8 from jvdelisle at gcc dot gnu dot org  2010-06-22 01:24 
 ---
 atan2_1.f90 has failed on other platforms before too.  I think we just need:

  ! { dg-options -ffloat-store }

 or maybe this

  ! { dg-options -O0 -ffloat-store }

 in the test file.  Can you try that and see if it clears your problem. Add it
 right after the line that says ! { dg-do run }

The first variant works like a charm: this way, we still iterate over
several optimization levels, which would be defeated by the second one.

Rainer


-- 


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



[Bug fortran/44448] 32-bit gfortran.dg/atan2_1.f90 fails on Solaris 1[01]/x86 at -O0

2010-06-21 Thread ro at CeBiTec dot Uni-Bielefeld dot DE


--- Comment #7 from ro at CeBiTec dot Uni-Bielefeld dot DE  2010-06-21 
12:47 ---
Subject: Re:  32-bit gfortran.dg/atan2_1.f90 fails on Solaris 1[01]/x86 at -O0

 --- Comment #6 from kargl at gcc dot gnu dot org  2010-06-16 21:51 ---
 (In reply to comment #5)
 This makes no sense at all. Rainer, I'm really sorry if it seems that I'm
 shooting questions a bit at random, but I have a hard time imagining how to
 narrow it down.
 
 Can you try the following equivalent C code (at -O0):

Sure: same differences as in the Fortran case:

-4.35483e-08
-4.35483e-08
-1.08095e-16
-1.08095e-16
4.33013e-08
4.33013e-08
4.38018e-17
4.38018e-17
3.05453e-08
3.05453e-08
3.33934e-17
3.33934e-17
2.96684e-08
2.96684e-08
-5.76796e-17
-5.76796e-17
4.87235e-08
4.87235e-08
-9.40003e-17
-9.40003e-17
-1.70395e-08
-1.70395e-08
2.55872e-17
2.55872e-17
1.2215e-09
1.2215e-09
-3.88144e-17
-3.88144e-17
2.30691e-08
2.30691e-08
-2.1684e-18
-2.1684e-18
-1.41206e-08
-1.41206e-08
-8.18573e-18
-8.18573e-18
2.18557e-08
2.18557e-08
-3.06287e-17
-3.06287e-17

 Right now, the only thing I can see make sense is numerically instability in
 the libm. Also, how are atan2f and atan2 defined in the system's math.h 
 header?
 Do they have simple prototypes? Are they actually macros?

The declarations are in iso/math_c99.h:

iso/math_c99.h:

extern float atanf __P((float));
extern float atan2f __P((float, float));

#if !defined(__cplusplus)
#pragma does_not_read_global_data(acosf, asinf, atanf, atan2f)
#pragma does_not_write_global_data(acosf, asinf, atanf, atan2f)

#if defined(__MATHERR_ERRNO_DONTCARE)
#pragma no_side_effect(acosf, asinf, atanf, atan2f)

 Does -ffloat-store change the outcome?  This looks to possibly
 be an excess precision problem and the difference between something
 in a register and main memory.

Indeed: with -ffloat-store, the test program only prints 0s.

Rainer


-- 


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



[Bug fortran/44448] 32-bit gfortran.dg/atan2_1.f90 fails on Solaris 1[01]/x86 at -O0

2010-06-21 Thread jvdelisle at gcc dot gnu dot org


--- Comment #8 from jvdelisle at gcc dot gnu dot org  2010-06-22 01:24 
---
atan2_1.f90 has failed on other platforms before too.  I think we just need:

 ! { dg-options -ffloat-store }

or maybe this

 ! { dg-options -O0 -ffloat-store }

in the test file.  Can you try that and see if it clears your problem. Add it
right after the line that says ! { dg-do run }


-- 


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



[Bug fortran/44448] 32-bit gfortran.dg/atan2_1.f90 fails on Solaris 1[01]/x86 at -O0

2010-06-16 Thread ro at gcc dot gnu dot org


--- Comment #4 from ro at gcc dot gnu dot org  2010-06-16 16:16 ---
Created an attachment (id=20929)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20929action=view)
gfortran -fdump-tree-original output 


-- 


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



[Bug fortran/44448] 32-bit gfortran.dg/atan2_1.f90 fails on Solaris 1[01]/x86 at -O0

2010-06-16 Thread fxcoudert at gcc dot gnu dot org


--- Comment #5 from fxcoudert at gcc dot gnu dot org  2010-06-16 21:30 
---
This makes no sense at all. Rainer, I'm really sorry if it seems that I'm
shooting questions a bit at random, but I have a hard time imagining how to
narrow it down.

Can you try the following equivalent C code (at -O0):


#include math.h
#include stdio.h

int main (void)
{
  int i;
  float x;
  double y;

  for (i = 1; i = 10; i++)
  {
x = __builtin_atan2f (1.f, (float) i / 10.f)
- __builtin_atan2f (1.f, (float) i / 10.f);
printf (%g\n, x);

x = atan2f (1.f, (float) i / 10.f)
- atan2f (1.f, (float) i / 10.f);
printf (%g\n, x);

y = __builtin_atan2 (1., (double) i / 10.)
- __builtin_atan2 (1., (double) i / 10.);
printf (%lg\n, y);

y = atan2 (1., (double) i / 10.)
- atan2 (1., (double) i / 10.);
printf (%lg\n, y);
  }

  return 0;
}


Right now, the only thing I can see make sense is numerically instability in
the libm. Also, how are atan2f and atan2 defined in the system's math.h header?
Do they have simple prototypes? Are they actually macros?


-- 


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



[Bug fortran/44448] 32-bit gfortran.dg/atan2_1.f90 fails on Solaris 1[01]/x86 at -O0

2010-06-16 Thread kargl at gcc dot gnu dot org


--- Comment #6 from kargl at gcc dot gnu dot org  2010-06-16 21:51 ---
(In reply to comment #5)
 This makes no sense at all. Rainer, I'm really sorry if it seems that I'm
 shooting questions a bit at random, but I have a hard time imagining how to
 narrow it down.
 
 Can you try the following equivalent C code (at -O0):
 


(Code)

 
 
 Right now, the only thing I can see make sense is numerically instability in
 the libm. Also, how are atan2f and atan2 defined in the system's math.h 
 header?
 Do they have simple prototypes? Are they actually macros?
 

Does -ffloat-store change the outcome?  This looks to possibly
be an excess precision problem and the difference between something
in a register and main memory.


-- 


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



[Bug fortran/44448] 32-bit gfortran.dg/atan2_1.f90 fails on Solaris 1[01]/x86 at -O0

2010-06-15 Thread ro at CeBiTec dot Uni-Bielefeld dot DE


--- Comment #2 from ro at CeBiTec dot Uni-Bielefeld dot DE  2010-06-15 
14:09 ---
Subject: Re:  32-bit gfortran.dg/atan2_1.f90 fails on Solaris 1[01]/x86 at -O0

 --- Comment #1 from fxcoudert at gcc dot gnu dot org  2010-06-11 13:51 
 ---
   if(atan(1.0,  i/10.0)  -atan2(1.0,  i/10.)/= 0.0)   call abort()

 Try to change that into a print *, atan(1.0,  i/10.0)  -atan2(1.0,  i/10.)
 and see what it outputs.

Only changing the first line, I get

 -4.35482832E-08
Abort

Changing the second line, too, gives

 -4.35482832E-08
 -1.08094956596804792E-016
  4.33012666E-08
  4.38017677684143791E-017
  3.05452623E-08
  3.33934269125535366E-017
  2.96684455E-08
 -5.7679762288359E-017
  4.87235496E-08
 -9.40003283544932344E-017
 -1.70394934E-08
  2.55871712706579046E-017
  1.22149613E-09
 -3.88144377749810587E-017
  2.30690667E-08
 -2.16840434497100887E-018
 -1.41206291E-08
 -8.18572640226555848E-018
  2.18556941E-08
 -3.06287113727155003E-017

Rainer


-- 


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



[Bug fortran/44448] 32-bit gfortran.dg/atan2_1.f90 fails on Solaris 1[01]/x86 at -O0

2010-06-15 Thread fxcoudert at gcc dot gnu dot org


--- Comment #3 from fxcoudert at gcc dot gnu dot org  2010-06-15 20:10 
---
(In reply to comment #2)
 Try to change that into a print *, atan(1.0,  i/10.0)  -atan2(1.0,  i/10.)
 and see what it outputs.
 
 Only changing the first line, I get
 
  -4.35482832E-08
 Abort

Changing only the first line, could you compile with -fdump-tree-original and
attach the *.f90.003t.original file that gets generated?


-- 


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



[Bug fortran/44448] 32-bit gfortran.dg/atan2_1.f90 fails on Solaris 1[01]/x86 at -O0

2010-06-11 Thread fxcoudert at gcc dot gnu dot org


--- Comment #1 from fxcoudert at gcc dot gnu dot org  2010-06-11 13:51 
---
   if(atan(1.0,  i/10.0)  -atan2(1.0,  i/10.)/= 0.0)   call abort()

Try to change that into a print *, atan(1.0,  i/10.0)  -atan2(1.0,  i/10.)
and see what it outputs.


-- 

fxcoudert at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||fxcoudert at gcc dot gnu dot
   ||org


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