re PR fortran/67496 (trans-array.c sanitizer runtime error: load of value 124, which...
authorJakub Jelinek <jakub@gcc.gnu.org>
Wed, 17 Aug 2016 19:08:49 +0000 (21:08 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 17 Aug 2016 19:08:49 +0000 (21:08 +0200)
PR fortran/67496
* trans-array.c (trans_array_constructor): Load
expr->ts.u.cl->length_from_typespec only if expr->ts.type is
BT_CHARACTER.

* gfortran.dg/pr67496.f90: New test.

From-SVN: r239544

gcc/fortran/ChangeLog
gcc/fortran/trans-array.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr67496.f90 [new file with mode: 0644]

index c6d1ff3859866f060f46d652b86be14e3a6737af..53c17042b7cc96be619ff51c6eea4d77f3fc9f49 100644 (file)
@@ -1,6 +1,12 @@
+2016-08-17  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/67496
+       * trans-array.c (trans_array_constructor): Load
+       expr->ts.u.cl->length_from_typespec only if expr->ts.type is
+       BT_CHARACTER.
+
 2016-08-15  Fritz Reese  <fritzoreese@gmail.com>
 
-       gcc/fortran/
        * lang.opt, invoke.texi: New flag -finit-derived.
        * gfortran.h (gfc_build_default_init_expr, gfc_apply_init,
        gfc_generate_initializer): New prototypes.
index bd232c28cc330ce14e71645aa1805489c015a54a..2699a767dbf164c9e53425f2293f91619b4ef953 100644 (file)
@@ -2239,7 +2239,8 @@ trans_array_constructor (gfc_ss * ss, locus * where)
 
   /* Do bounds-checking here and in gfc_trans_array_ctor_element only if no
      typespec was given for the array constructor.  */
-  typespec_chararray_ctor = (expr->ts.u.cl
+  typespec_chararray_ctor = (expr->ts.type == BT_CHARACTER
+                            && expr->ts.u.cl
                             && expr->ts.u.cl->length_from_typespec);
 
   if ((gfc_option.rtcheck & GFC_RTCHECK_BOUNDS)
index 2c6ed263dca7327cd71555da58fb14c8321eea80..f1a0fa86c34a5ca485105f32d1cd197a014c8e71 100644 (file)
@@ -1,7 +1,12 @@
+2016-08-17  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/67496
+       * gfortran.dg/pr67496.f90: New test.
+
 2015-08-17  Alan Hayward <alan.hayward@arm.com>
 
        PR tree-optimization/71752
-       * gcc.dg/vect/pr71752.c: New
+       * gcc.dg/vect/pr71752.c: New.
 
 2016-08-17  Uros Bizjak  <ubizjak@gmail.com>
 
 2016-08-08  Martin Sebor  <msebor@redhat.com>
 
        PR testsuite/72838
-       * gcc/testsuite/g++.dg/cpp0x/constexpr-cast.C: Correct target selector.
-       * gcc/testsuite/g++.dg/warn/overflow-warn-3.C: Same.
-       * gcc/testsuite/g++.dg/warn/overflow-warn-4.C: Same.
+       * g++.dg/cpp0x/constexpr-cast.C: Correct target selector.
+       * g++.dg/warn/overflow-warn-3.C: Same.
+       * g++.dg/warn/overflow-warn-4.C: Same.
 
 2016-08-08  Andre Vehreschild  <vehre@gcc.gnu.org>
 
 2016-07-05  David Malcolm  <dmalcolm@redhat.com>
 
        PR c++/62314
-       * gcc/testsuite/g++.dg/parse/error5.C: Update column
+       * g++.dg/parse/error5.C: Update column
        number of missing semicolon error.
        * g++.dg/pr62314-2.C: New test case.
 
 
 2016-07-04  Yuri Rumyantsev  <ysrumyan@gmail.com>
 
-       * gcc/testsuite/gcc.target/i386/avx512f-vect-perm-1.c: New test.
-       * gcc/testsuite/gcc.target/i386/avx512f-vect-perm-2.c: New test.
+       * gcc.target/i386/avx512f-vect-perm-1.c: New test.
+       * gcc.target/i386/avx512f-vect-perm-2.c: New test.
 
 2016-07-04  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
 
 2016-06-16  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/71242
-       * testsuite/gcc.dg/torture/float128-nan.c: Also run on ia64-*-*.
+       * gcc.dg/torture/float128-nan.c: Also run on ia64-*-*.
 
 2016-06-16  Jan Hubicka  <hubicka@ucw.cz>
 
 2016-06-12  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/71241
-       * testsuite/gcc.dg/torture/float128-nan.c: New test.
+       * gcc.dg/torture/float128-nan.c: New test.
 
 2016-06-12  Dominique d'Humieres  <dominiq@lps.ens.fr>
 
diff --git a/gcc/testsuite/gfortran.dg/pr67496.f90 b/gcc/testsuite/gfortran.dg/pr67496.f90
new file mode 100644 (file)
index 0000000..7543102
--- /dev/null
@@ -0,0 +1,12 @@
+! PR fortran/67496
+! { dg-do compile }
+
+  type :: a
+  end type a
+  type :: b
+    type (a) :: j(1)
+  end type b
+  type(a) :: x
+  type(b) :: y
+  y = b((/x/))
+end