2006-06-23 Steven G. Kargl <kargls@comcast.net>
authorkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 23 Jun 2006 21:05:04 +0000 (21:05 +0000)
committerkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 23 Jun 2006 21:05:04 +0000 (21:05 +0000)
PR fortran/27981
* match.c (gfc_match_if):  Handle errors in assignment in simple if.

2006-06-23  Steven G. Kargl  <kargls@comcast.net>

PR fortran/27981
* gfortran.dg/simpleif_2.f90: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114950 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/match.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/simpleif_2.f90 [new file with mode: 0644]

index a02bebd..3b3584c 100644 (file)
@@ -1,3 +1,8 @@
+2006-06-23  Steven G. Kargl  <kargls@comcast.net>
+
+       PR fortran/27981
+       * match.c (gfc_match_if):  Handle errors in assignment in simple if.
+
 2006-06-22  Asher Langton  <langton2@llnl.gov>
 
        PR fortran/24748
index 448d927..0ad5e13 100644 (file)
@@ -1061,6 +1061,12 @@ gfc_match_if (gfc_statement * if_type)
   gfc_undo_symbols ();
   gfc_current_locus = old_loc;
 
+  /* m can be MATCH_NO or MATCH_ERROR, here.  For MATCH_NO, continue to
+     call the various matchers.  For MATCH_ERROR, a mangled assignment
+     was found.  */
+  if (m == MATCH_ERROR)
+    return MATCH_ERROR;
+
   gfc_match (" if ( %e ) ", &expr);    /* Guaranteed to match */
 
   m = gfc_match_pointer_assignment ();
index d6deeb9..3cb9151 100644 (file)
@@ -1,3 +1,8 @@
+2006-06-23  Steven G. Kargl  <kargls@comcast.net>
+
+       PR fortran/27981
+       * gfortran.dg/simpleif_2.f90: New test.
+
 2006-06-23  Lee Millward  <lee.millward@gmail.com>
 
        * g++.dg/template/error22.C: Fix typo.
diff --git a/gcc/testsuite/gfortran.dg/simpleif_2.f90 b/gcc/testsuite/gfortran.dg/simpleif_2.f90
new file mode 100644 (file)
index 0000000..0d8e6dd
--- /dev/null
@@ -0,0 +1,7 @@
+! { dg-do compile }
+! PR 27981
+program a
+   real x
+   real, pointer :: y
+   if (.true.) x = 12345678901 ! { dg-error "Integer too big" }
+end program a