2011-10-17 Janus Weil <janus@gcc.gnu.org>
authorjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 17 Oct 2011 09:46:30 +0000 (09:46 +0000)
committerjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 17 Oct 2011 09:46:30 +0000 (09:46 +0000)
PR fortran/47023
PR fortran/50752
* primary.c (match_kind_param): Avoid segfault.

2011-10-17  Janus Weil  <janus@gcc.gnu.org>

PR fortran/47023
PR fortran/50752
* gfortran.dg/kind_tests_4.f90: New.

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

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

index 1d515dc..4866956 100644 (file)
@@ -1,3 +1,9 @@
+2011-10-17  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/47023
+       PR fortran/50752
+       * primary.c (match_kind_param): Avoid segfault.
+
 2011-10-16  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        * frontend-passes.c (current_ns):  Make static.
index 748185a..23dc0b6 100644 (file)
@@ -57,11 +57,11 @@ match_kind_param (int *kind, int *is_iso_c)
   if (gfc_find_symbol (name, NULL, 1, &sym))
     return MATCH_ERROR;
 
-  *is_iso_c = sym->attr.is_iso_c;
-
   if (sym == NULL)
     return MATCH_NO;
 
+  *is_iso_c = sym->attr.is_iso_c;
+
   if (sym->attr.flavor != FL_PARAMETER)
     return MATCH_NO;
 
index 496d661..4828e09 100644 (file)
@@ -1,3 +1,9 @@
+2011-10-17  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/47023
+       PR fortran/50752
+       * gfortran.dg/kind_tests_4.f90: New.
+
 2011-10-17  Ira Rosen  <ira.rosen@linaro.org>
 
        * gcc.dg/vect/vect-21.c: Expect the loops to get vectorized on
diff --git a/gcc/testsuite/gfortran.dg/kind_tests_4.f90 b/gcc/testsuite/gfortran.dg/kind_tests_4.f90
new file mode 100644 (file)
index 0000000..050c15a
--- /dev/null
@@ -0,0 +1,8 @@
+! { dg-do compile }
+!
+! PR 50752: [4.7 Regression] ICE in match_kind_param
+!
+! Contributed by Joost VandeVondele <Joost.VandeVondele@pci.uzh.ch>
+
+rPos=0.0_dp  ! { dg-error "Missing kind-parameter" }
+end