This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/36186] New: Wrong handling of BOZ in CMPLX
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 May 2008 09:39:28 -0000
- Subject: [Bug fortran/36186] New: Wrong handling of BOZ in CMPLX
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
$ cat a.f90
program test0
implicit none
integer :: x = 1
write(*,*) cmplx(b'01000000001010010101001111111101',1,4)
write(*,*) cmplx(b'01000000001010010101001111111101',x,4)
end program test0
$ gfortran a.f90
$ ./a.out
( 2.6457512 , 1.00000000 )
( 1.07645030E+09, 1.00000000 )
This is because we don't simplify the second case, and then we convert the boz,
which is represented as a maximal-size integer, into a real; as the integer is
too long, that doesn't work.
I believe it's the only place that can happen, as for other intrinsics, there
*always* is simplification in such a case. What we should do is not too clear
to me, maybe a BOZ expert could help: one thing possible is to trap that case
in the simplification routine, and even if we can't simplify the whole
intrinsic, we silently convert the BOZ there; or we take care of it in
trans-intrinsic.c.
--
Summary: Wrong handling of BOZ in CMPLX
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: fxcoudert at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36186