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



             Bug #: 57160

           Summary: short-circuit IF only with -ffrontend-optimize

    Classification: Unclassified

           Product: gcc

           Version: 4.9.0

            Status: UNCONFIRMED

          Severity: enhancement

          Priority: P3

         Component: fortran

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: joost.vandevond...@mat.ethz.ch





it would be nice to have the short-circuit evaluation of IF statements only if

-ffrontend-optimize is in place. It would help to capture (at -O0) bugs like:



MODULE M1

 TYPE T1

   LOGICAL :: T=.TRUE.

 END TYPE T1

CONTAINS

 SUBROUTINE S1(m)

   TYPE(T1), POINTER :: m

   IF (ASSOCIATED(m) .AND. m%T) THEN

    WRITE(6,*) "X"

   ENDIF

 END SUBROUTINE

END MODULE



USE M1

 TYPE(T1), POINTER :: m=>NULL()

 CALL S1(m)

END



where I would like the code to segfault.

Reply via email to