re PR fortran/50163 (ICE: initialization expression)
authorTobias Burnus <burnus@net-b.de>
Wed, 24 Aug 2011 13:11:08 +0000 (15:11 +0200)
committerTobias Burnus <burnus@gcc.gnu.org>
Wed, 24 Aug 2011 13:11:08 +0000 (15:11 +0200)
2011-08-24  Tobias Burnus  <burnus@net-b.de>

        PR fortran/50163
        * expr.c (check_init_expr): Return when an error
        occured.

2011-08-24  Tobias Burnus  <burnus@net-b.de>

        PR fortran/50163
        * gfortran.dg/initialization_28.f90: New.

From-SVN: r178038

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

index 7e8d1af01027438262dc6223d5b8051fc38ab321..ed4dc77f020a99c8632e31ac9eff7bf66a274003 100644 (file)
@@ -1,3 +1,8 @@
+2011-08-24  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/50163
+       * expr.c (check_init_expr): Return when an error occured.
+
 2011-08-24  Joseph Myers  <joseph@codesourcery.com>
 
        * Make-lang.in (fortran/cpp.o): Remove explicit compilation rule.
index 9922094fd6e26b2c08106215b8658da920b5168a..b050b116ca5d004674518622e94bc8211fe36a53 100644 (file)
@@ -2481,6 +2481,9 @@ check_init_expr (gfc_expr *e)
            m = MATCH_ERROR;
          }
 
+       if (m == MATCH_ERROR)
+         return FAILURE;
+
        /* Try to scalarize an elemental intrinsic function that has an
           array argument.  */
        isym = gfc_find_function (e->symtree->n.sym->name);
index 96641172a4bbfd75f70524d8ce83f11818615f74..d140a438ed6da67ffb3a76f118b70cbf0276d7fe 100644 (file)
@@ -1,3 +1,8 @@
+2011-08-24  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/50163
+       * gfortran.dg/initialization_28.f90: New.
+
 2011-08-24  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/50067
diff --git a/gcc/testsuite/gfortran.dg/initialization_28.f90 b/gcc/testsuite/gfortran.dg/initialization_28.f90
new file mode 100644 (file)
index 0000000..f533053
--- /dev/null
@@ -0,0 +1,9 @@
+! { dg-do compile }
+!
+! PR fortran/50163
+!
+! Contributed by Philip Mason
+!
+character(len=2) :: xx ='aa'
+integer :: iloc=index(xx,'bb') ! { dg-error "has not been declared or is a variable" }
+end