The following code:

SUBROUTINE pw_sumup (alpha_im)
  REAL, INTENT(in), OPTIONAL :: alpha_im
  COMPLEX :: my_alpha_c
  IF (PRESENT(alpha_im)) THEN
     my_alpha_c = CMPLX(0.,alpha_im)
  END IF
END SUBROUTINE pw_sumup

ICEs on both 4.2 and 4.3, but compiles fine on 4.1.2. The ICE for 4.3 is:
foo.f90: In function ‘pw_sumup’:
foo.f90:1: internal compiler error: in build_int_cst_wide, at tree.c:852

The ICE for 4.2 is:
foo.f90: In function ‘pw_sumup’:
foo.f90:5: internal compiler error: in immed_double_const, at emit-rtl.c:464

CCing Paul and Erik, because he commited some "optional args" patch recently if
I remember correctly.


-- 
           Summary: [4.2/4.3 regression] ICE on optional arg
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-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=29976

Reply via email to