This is the mail archive of the 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]

[PATCH] fortran/28866 -- Fix not so simple simple IF

The attached patch has been regression tested on i386-*-freebsd
with no new regression.  This patch represents a fix to a previous
patch that I committed.  I'm surprised it has not been flagged
by someone else.  I apologies for breaking the compiler. :(

! Test fix for regression caused by 
! 2006-06-23  Steven G. Kargl  <>
!    PR fortran/27981
!    * match.c (gfc_match_if):  Handle errors in assignment in simple if.
module read
  integer i, j, k
    subroutine a
      if (i .eq. 0) read(j,*) k  ! <-- This dies a horrible death.
    end subroutine a
end module read

The problem is gfc_match_assignment returned either MATCH_YES
or MATCH_ERROR.  In my original patch, I apparently thought
that it could also return a MATCH_NO.  This patch re-arranges
the error handling in gfc_match_assignment.  In particular,
the failure to match an lvalue now returns a MATCH_NO, and
the error checking for assignment to a PARAMETER has been 
pushed down into primary.c(match_variable).  One nice outcome
to checking for a PARAMETER in match_variables allows gfortran
to report a much more informative error message when someone
uses a named constant in an EQUIVALENCE.

2006-08-27  Steven G. Kargl  <>

	PR fortran/28866 
	* match.c (gfc_match_assignment): Re-arrange error handling of failed
	matches.  Move FL_PARAMETER check to ...
	* primary.c: Wrap Copyright info.
	(match_variable): ... here.  Enhance error messages.

2006-08-27  Steven G. Kargl  <>

	PR fortran/28866
	* gfortran.dg/simpleif_2.f90: New test.
	* gfortran.dg/pr19936_1.f90: Fix dg-error message.
	* gfortran.dg/enum_5.f90: Ditto.


Attachment: simpleif.diff
Description: Text document

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