This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/29284] [4.1/4.2 Regression] ICE for optional subroutine argument



------- Comment #4 from rep dot nop at aon dot at  2006-10-01 15:28 -------
Note that i don't think i can approve anything.
This patch fixes the following ICE for me:

http://gcc.gnu.org/ml/fortran/2006-09/msg00460.html

$ cat no.f90
        MODULE MOD1
        CONTAINS
        SUBROUTINE SUB1(arg)
        IMPLICIT NONE
        CHARACTER (LEN=*), OPTIONAL :: arg
        IF (PRESENT(arg)) WRITE(0,*) 'arg was ', arg
        STOP
        END SUBROUTINE SUB1
        SUBROUTINE SUB2
        CALL SUB1
        END SUBROUTINE SUB2
        END MODULE

Used to give before this fix
$ gfortran-4.2-HEAD -c no.f90
no.f90: In function 'sub2':
no.f90:3: internal compiler error: Segmentation fault

And with the fix compiles now as expected.

PS: Just curious..
Why isn't this part of gfc_conv_function_call() coded to check for fsym once
and only then have the additional checks?

if (fsym)
  {
    CHECKS_NOT_INVOLVING_e;
    if (e)
      {
        CHECK_e_STUFF;
      }
   }

It doesn't look like the order of most of these is significant since very
different things are checked, so there should be no risk in writing this in a
sleek manner.


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]