[Bug fortran/36214] Wrong simplification of BOZ constants

2008-12-24 Thread pinskia at gcc dot gnu dot org


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

   Target Milestone|--- |4.4.0


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



[Bug fortran/36214] Wrong simplification of BOZ constants

2008-09-14 Thread domob at gcc dot gnu dot org


--- Comment #9 from domob at gcc dot gnu dot org  2008-09-14 09:59 ---
Subject: Bug 36214

Author: domob
Date: Sun Sep 14 09:57:50 2008
New Revision: 140358

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=140358
Log:
2008-09-11  Daniel Kraft  [EMAIL PROTECTED]

PR fortran/36214
* simplify.c (simplify_cmplx): Added linebreak to long line.
* target-memory.c (gfc_convert_boz): Fix indentation.
(gfc_interpret_float): Set mpfr precision to right value before
calling mpfr_init.

2008-09-11  Daniel Kraft  [EMAIL PROTECTED]

PR fortran/36214
* gfortran.dg/boz_9.f90: Corrected test.
* gfortran.dg/boz_11.f90: New test.
* gfortran.dg/boz_12.f90: New test.

Added:
branches/gcc-4_3-branch/gcc/testsuite/gfortran.dg/boz_11.f90
branches/gcc-4_3-branch/gcc/testsuite/gfortran.dg/boz_12.f90
Modified:
branches/gcc-4_3-branch/gcc/fortran/ChangeLog
branches/gcc-4_3-branch/gcc/fortran/simplify.c
branches/gcc-4_3-branch/gcc/fortran/target-memory.c
branches/gcc-4_3-branch/gcc/testsuite/ChangeLog
branches/gcc-4_3-branch/gcc/testsuite/gfortran.dg/boz_9.f90


-- 


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



[Bug fortran/36214] Wrong simplification of BOZ constants

2008-09-14 Thread domob at gcc dot gnu dot org


--- Comment #10 from domob at gcc dot gnu dot org  2008-09-14 10:02 ---
Fixed for trunk (4.4) and 4.3.


-- 

domob at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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



[Bug fortran/36214] Wrong simplification of BOZ constants

2008-09-11 Thread domob at gcc dot gnu dot org


--- Comment #8 from domob at gcc dot gnu dot org  2008-09-11 07:29 ---
Subject: Bug 36214

Author: domob
Date: Thu Sep 11 07:28:18 2008
New Revision: 140264

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=140264
Log:
2008-09-11  Daniel Kraft  [EMAIL PROTECTED]

PR fortran/36214
* simplify.c (simplify_cmplx): Added linebreak to long line.
* target-memory.c (gfc_convert_boz): Fix indentation.
(gfc_interpret_float): Set mpfr precision to right value before
calling mpfr_init.

2008-09-11  Daniel Kraft  [EMAIL PROTECTED]

PR fortran/36214
* gfortran.dg/boz_9.f90: Corrected test.
* gfortran.dg/boz_13.f90: New test.
* gfortran.dg/boz_14.f90: New test.

Added:
trunk/gcc/testsuite/gfortran.dg/boz_13.f90
trunk/gcc/testsuite/gfortran.dg/boz_14.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/simplify.c
trunk/gcc/fortran/target-memory.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/boz_9.f90


-- 


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



[Bug fortran/36214] Wrong simplification of BOZ constants

2008-09-10 Thread domob at gcc dot gnu dot org


--- Comment #4 from domob at gcc dot gnu dot org  2008-09-10 14:54 ---
I see the same problem with the program below:

implicit none
   real, parameter :: r = 0.0
   real(kind=8), parameter :: rd = real(b'
 0110100101010001', 8)

   if (real (b'
  0110100101010001', 8) /= rd) call abort
end

I'll try to investigate this interesting looking problem :P


-- 

domob at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |domob at gcc dot gnu dot org
   |dot org |
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2008-09-10 14:54:45
   date||


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



[Bug fortran/36214] Wrong simplification of BOZ constants

2008-09-10 Thread kargl at gcc dot gnu dot org


--- Comment #5 from kargl at gcc dot gnu dot org  2008-09-10 15:42 ---
Daniel, 

I looked at this briefly last week.  Here's another test case that might be
easier to trace.  

   implicit none
   real(4) r
   real(8) rd
   complex(8) z
   rd = 
dble(b'0110100101010001')
   z  =
cmplx(b'0110100101010001',0,8)
   r = 0.
   if (z /= rd) call abort
   end

Of course, bugzilla has wrapped the long lines.

-fdump-parse-tree gives
  ASSIGN MAIN__:rd 5.31837115e-315_8
  ASSIGN MAIN__:z (complex 5.3183711317956924e-315_8 0_8)
  ASSIGN MAIN__:r 0
  IF (/= MAIN__:z __convert_r8_c8[[((MAIN__:rd))]])
CALL _gfortran_abort ()
  ENDIF

I suspect that the conversion of the boz to the rd value is 
done with a kind=4 conversion rather than kind=8, but I haven't
been able to substantial my suspicions.


-- 


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



[Bug fortran/36214] Wrong simplification of BOZ constants

2008-09-10 Thread domob at gcc dot gnu dot org


--- Comment #6 from domob at gcc dot gnu dot org  2008-09-10 16:08 ---
 -fdump-parse-tree gives
   ASSIGN MAIN__:rd 5.31837115e-315_8
   ASSIGN MAIN__:z (complex 5.3183711317956924e-315_8 0_8)
   ASSIGN MAIN__:r 0
   IF (/= MAIN__:z __convert_r8_c8[[((MAIN__:rd))]])
 CALL _gfortran_abort ()
   ENDIF
 
 I suspect that the conversion of the boz to the rd value is 
 done with a kind=4 conversion rather than kind=8, but I haven't
 been able to substantial my suspicions.

That looks truely suspicious...  I'm currently waiting for the current trunk
build to finish and will then investigate.  This part of the code will
hopefully be another interesting learning experience :D


-- 


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



[Bug fortran/36214] Wrong simplification of BOZ constants

2008-09-10 Thread domob at gcc dot gnu dot org


--- Comment #7 from domob at gcc dot gnu dot org  2008-09-10 19:04 ---
The problem is that gfc_interpret_float does not set the default mpfr precision
to the value for its kind parameter but leaves the setting that is already
present.  This is presumably the reason why inserting the dummy variable
changed the test's behaviour, because this made caused the precision to be set
to that for KIND=4 for the dummy variable.  Adding this initialization fixes
the problem.

I will submit a patch shortly.


-- 


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



[Bug fortran/36214] Wrong simplification of BOZ constants

2008-08-08 Thread jv244 at cam dot ac dot uk


--- Comment #3 from jv244 at cam dot ac dot uk  2008-08-08 22:15 ---
Maybe a hint from xlf90:

xlf90 test.f90
test.f90, line 3.41: 1516-045 (E) Source is longer than target. Truncation
will occur on the left.
test.f90, line 6.14: 1516-045 (E) Source is longer than target. Truncation
will occur on the left.

and xlf90 works code works fine.


-- 

jv244 at cam dot ac dot uk changed:

   What|Removed |Added

   Keywords||wrong-code
  Known to fail||4.4.0


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