public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/19575] New: cdabs intrinsic incorrectly handled with -std=f95
@ 2005-01-22 11:57 coudert at clipper dot ens dot fr
2005-01-22 15:48 ` [Bug fortran/19575] " pinskia at gcc dot gnu dot org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: coudert at clipper dot ens dot fr @ 2005-01-22 11:57 UTC (permalink / raw)
To: gcc-bugs
The following code:
program abs_test1
implicit none
intrinsic cdabs
! write(*,*) cdabs((4,3)) ! Causes ICE, as well
call sub(cdabs)
end program abs_test1
subroutine sub(f)
implicit none
interface
elemental function f(x)
complex(kind(1.0d0)), intent(in) :: x
real(kind(x)) :: f
end function f
end interface
complex(kind(1.0d0)) x
x = (4,3)
write(*,*) f(x)
end subroutine sub
has an incorrect behavior when -std=f95 is specified (according to James Van
Buskirk, see
http://home.comcast.net/~kmbtib/gfortran_bugs/REF_JVB_GFTN_003.html). On
powerpc-apple-darwin, I get:
$ gfortran abs_test1.f90 && ./a.out
5.00000000000000
$ gfortran abs_test1.f90 -std=f95 && ./a.out
2.25000000000000
while on i686-mingw:
$ gfortran abs_test1.f90 && ./a.out
5.00000000000000
$ gfortran abs_test1.f90 -std=f95 && ./a.out
NaN
Another related issue: when uncommenting the commented line, the behavior is
correct without -std=f95 (error issued at compile-time), but -std=f95 causes ICE:
$ gfortran abs_test1.f90 -std=f95 && ./a.out
abs_test1.f90: In function 'MAIN__':
abs_test1.f90:12: internal compiler error: in gfc_typenode_for_spec, at
fortran/trans-types.c:613
--
Summary: cdabs intrinsic incorrectly handled with -std=f95
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: coudert at clipper dot ens dot fr
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19575
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/19575] cdabs intrinsic incorrectly handled with -std=f95
2005-01-22 11:57 [Bug fortran/19575] New: cdabs intrinsic incorrectly handled with -std=f95 coudert at clipper dot ens dot fr
@ 2005-01-22 15:48 ` pinskia at gcc dot gnu dot org
2005-01-22 19:25 ` sgk at troutmask dot apl dot washington dot edu
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-22 15:48 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-22 15:48 -------
sub (specific__abs_c8);
sub (specific__abs_c4);
Hmm, I don't know what should be happening with intrinsics at all in this case
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19575
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/19575] cdabs intrinsic incorrectly handled with -std=f95
2005-01-22 11:57 [Bug fortran/19575] New: cdabs intrinsic incorrectly handled with -std=f95 coudert at clipper dot ens dot fr
2005-01-22 15:48 ` [Bug fortran/19575] " pinskia at gcc dot gnu dot org
@ 2005-01-22 19:25 ` sgk at troutmask dot apl dot washington dot edu
2005-01-22 20:00 ` sgk at troutmask dot apl dot washington dot edu
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: sgk at troutmask dot apl dot washington dot edu @ 2005-01-22 19:25 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From sgk at troutmask dot apl dot washington dot edu 2005-01-22 19:25 -------
Part of the problem is due to the following from intrinsic.c
add_sym_1 ("zabs", 1, 1, BT_REAL, dd, GFC_STD_GNU,
NULL, gfc_simplify_abs, gfc_resolve_abs,
a, BT_COMPLEX, dd, REQUIRED);
make_alias ("cdabs");
make_alias() does not set the GFC_STD_GNU flag. If you change
cdabs to zabs, you get
kargl[216] gfc -o y -std=f95 y.f90
In file y.f90:3
intrinsic zabs
1
Error: Intrinsic at (1) does not exist
which is the expected behavior. We still get the
NaN if -std=f95 is removed from the command line.
NAG's compiler states
kargl[224] f95 -o y -dcfuns y.f90
Error: y.f90, line 5: Intrinsic CDABS cannot be an actual argument
[f95 error termination]
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19575
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/19575] cdabs intrinsic incorrectly handled with -std=f95
2005-01-22 11:57 [Bug fortran/19575] New: cdabs intrinsic incorrectly handled with -std=f95 coudert at clipper dot ens dot fr
2005-01-22 15:48 ` [Bug fortran/19575] " pinskia at gcc dot gnu dot org
2005-01-22 19:25 ` sgk at troutmask dot apl dot washington dot edu
@ 2005-01-22 20:00 ` sgk at troutmask dot apl dot washington dot edu
2005-01-22 22:38 ` pinskia at gcc dot gnu dot org
2005-05-23 23:00 ` pinskia at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: sgk at troutmask dot apl dot washington dot edu @ 2005-01-22 20:00 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From sgk at troutmask dot apl dot washington dot edu 2005-01-22 20:00 -------
Patch to fix the nonstandard issue with -std=f95.
http://gcc.gnu.org/ml/gcc-patches/2005-01/msg01596.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19575
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/19575] cdabs intrinsic incorrectly handled with -std=f95
2005-01-22 11:57 [Bug fortran/19575] New: cdabs intrinsic incorrectly handled with -std=f95 coudert at clipper dot ens dot fr
` (2 preceding siblings ...)
2005-01-22 20:00 ` sgk at troutmask dot apl dot washington dot edu
@ 2005-01-22 22:38 ` pinskia at gcc dot gnu dot org
2005-05-23 23:00 ` pinskia at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-22 22:38 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-22 22:38 -------
Confirmed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |accepts-invalid
Last reconfirmed|0000-00-00 00:00:00 |2005-01-22 22:38:19
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19575
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/19575] cdabs intrinsic incorrectly handled with -std=f95
2005-01-22 11:57 [Bug fortran/19575] New: cdabs intrinsic incorrectly handled with -std=f95 coudert at clipper dot ens dot fr
` (3 preceding siblings ...)
2005-01-22 22:38 ` pinskia at gcc dot gnu dot org
@ 2005-05-23 23:00 ` pinskia at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-23 23:00 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-23 22:57 -------
Fixed since 4.0.0, someone forgot to close the bug.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19575
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-05-23 22:57 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-22 11:57 [Bug fortran/19575] New: cdabs intrinsic incorrectly handled with -std=f95 coudert at clipper dot ens dot fr
2005-01-22 15:48 ` [Bug fortran/19575] " pinskia at gcc dot gnu dot org
2005-01-22 19:25 ` sgk at troutmask dot apl dot washington dot edu
2005-01-22 20:00 ` sgk at troutmask dot apl dot washington dot edu
2005-01-22 22:38 ` pinskia at gcc dot gnu dot org
2005-05-23 23:00 ` pinskia 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).