Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Fortran > Internal compil...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 17 Topic 8388 of 8908
Post > Topic >>

Internal compiler error when both using and passing an intrinsic

by Allan Whiteford <allan.remove@[EMAIL PROTECTED] > Jun 17, 2008 at 12:48 PM

Hi,

I've tried to search on Google for this issue but I can't find any 
simple examples matching the problem I'm having. I'm not quite sure 
exactly how to phrase my search to Google so I thought maybe I could get 
some help here.

I've brought my problem down to the minimum I can; consider the following:

       SUBROUTINE MYSUB(A,F)
         REAL*8 A,F
         PRINT *,F(A)
       END

       PROGRAM TEST
       IMPLICIT NONE

       REAL*8     A,B
       INTRINSIC  DLOG

       A=3D0

       PRINT *,DLOG(A)		! LINE A
       CALL MYSUB(A,DLOG)	! LINE B

       END

If I run this through an old version of g77 (3.2.3) then the code 
compiles ok and gives me the output I'd expect (the natural log of 3 
printed twice). The initial code (which is much more involved than the 
above) was written as Fortran77 which is why we're still using g77 
sometimes.

If I try to use gfortran (versions given below) then I get an error 
message which looks like:

test2.for: In function 'MAIN__':
test2.for:14: internal compiler error: in gfc_typenode_for_spec, at 
fortran/trans-types.c:636
Please submit a full bug re****t,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla>
for instructions.

I've tried with the following versions of gfortran/gcc:

gcc version 4.0.2 20051125 (Red Hat 4.0.2-8)
gcc version 4.1.2 20070502 (Red Hat 4.1.2-12)
gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)

(The line nuber of trans-types.c differs between the two versions.)

I've not compiled my own version but both of the above are running on 
fairly generic Fedora systems (FC4, FC7 and FC8 respectively). I looked 
at http://gcc.gnu.org/wiki/GFortran#news
and didn't see anything which 
suggests that the issue has been addressed in versions 4.2, 4.3 or 4.4.

Interestingly, if I comment out either LINE A or LINE B the error goes 
away and I get the output I'd expect (in both cases the natural log of 3 
printed once). This leads me to suspect that the individual lines of 
Fortran are valid. The problem only occurs if I both use the intrinsic 
function DLOG and pass it to another subroutine in the same program (it 
also occurs if the main program here is a subroutine).

Another thing worthy of note that it's not the "print *" causing the 
problem, if I try to assign the result to a variable I get the same 
error but I thought that using a simple "print *" gave a better example 
for my questions.

Which are...

1) Is what I'm trying to do valid Fortran?

2) My understanding of internal errors is that they shouldn't ever 
appear to the user even when the user is doing something stupid, is this 
correct and should I file an official bug re****t about this issue?

3) I can think of some work-arounds for my problem as it stands but any 
suggestions people have would be very welcome. My current work-around 
would be to write a simple wrapper function around DLOG and pass that 
wrapper to MYSUB.

Thank you in advance for your help.

Thanks,

Allan
 




 17 Posts in Topic:
Internal compiler error when both using and passing an intrinsic
Allan Whiteford <allan  2008-06-17 12:48:35 
Re: Internal compiler error when both using and passing an intri
Herman D. Knoble <Skip  2008-06-17 08:25:22 
Re: Internal compiler error when both using and passing an intri
paul.richard.thomas@[EMAI  2008-06-17 05:57:21 
Re: Internal compiler error when both using and passing an intri
=?ISO-8859-1?Q?Jan_Vorbr=  2008-06-17 14:57:33 
Re: Internal compiler error when both using and passing an intri
Ken.Fairfield@[EMAIL PROT  2008-06-17 09:57:42 
Re: Internal compiler error when both using and passing an intri
nospam@[EMAIL PROTECTED]   2008-06-17 11:46:52 
Re: Internal compiler error when both using and passing an intri
glen herrmannsfeldt <g  2008-06-17 16:31:03 
Re: Internal compiler error when both using and passing an intri
nospam@[EMAIL PROTECTED]   2008-06-17 19:16:57 
Re: Internal compiler error when both using and passing an intri
harper@[EMAIL PROTECTED]   2008-06-19 11:40:27 
Re: Internal compiler error when both using and passing an intri
glen herrmannsfeldt <g  2008-06-18 17:47:15 
Re: Internal compiler error when both using and passing an intri
harper@[EMAIL PROTECTED]   2008-06-19 15:00:21 
Re: Internal compiler error when both using and passing an intri
nospam@[EMAIL PROTECTED]   2008-06-18 21:41:08 
Re: Internal compiler error when both using and passing an intri
"James Van Buskirk&q  2008-06-19 00:18:26 
Re: Internal compiler error when both using and passing an intri
harper@[EMAIL PROTECTED]   2008-06-20 10:12:31 
Re: Internal compiler error when both using and passing an intri
Tobias Burnus <burnus@  2008-06-17 12:36:49 
Re: Internal compiler error when both using and passing an intri
Ken.Fairfield@[EMAIL PROT  2008-06-17 13:20:09 
Re: Internal compiler error when both using and passing an intri
Allan Whiteford <allan  2008-06-18 12:38:12 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Nov 19 9:21:23 CST 2008.