aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven G. Kargl <kargl@gcc.gnu.org>2017-11-08 20:56:43 +0000
committerSteven G. Kargl <kargl@gcc.gnu.org>2017-11-08 20:56:43 +0000
commitfd5dce5c53117501297c17a4e092a13009d2c119 (patch)
tree32f10647204add1ca201098d5165479cde593a3d
parentdeef5083cda7b805977fe537f05b23da9406894e (diff)
downloadgcc-fd5dce5c53117501297c17a4e092a13009d2c119.zip
gcc-fd5dce5c53117501297c17a4e092a13009d2c119.tar.gz
gcc-fd5dce5c53117501297c17a4e092a13009d2c119.tar.bz2
re PR fortran/82884 (ICE in gfc_resolve_character_array_constructor, at fortran/array.c:2069)
2017-11-08 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/82884 * arith.c (gfc_hollerith2character): Clear pad. 2017-11-08 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/82884 * gfortran.dg/hollerith_character_array_constructor.f90: New test. From-SVN: r254553
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/arith.c1
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/hollerith_character_array_constructor.f9011
4 files changed, 22 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 8de4c1b..b554f9f 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,8 @@
+2017-11-08 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/82884
+ * arith.c (gfc_hollerith2character): Clear pad.
+
2017-11-08 Janne Blomqvist <jb@gcc.gnu.org>
PR 82869
diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c
index c3be14d..3c75895 100644
--- a/gcc/fortran/arith.c
+++ b/gcc/fortran/arith.c
@@ -2604,6 +2604,7 @@ gfc_hollerith2character (gfc_expr *src, int kind)
result = gfc_copy_expr (src);
result->ts.type = BT_CHARACTER;
result->ts.kind = kind;
+ result->ts.u.pad = 0;
result->value.character.length = result->representation.length;
result->value.character.string
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d20cadc..475cc27 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2017-11-08 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/82884
+ * gfortran.dg/hollerith_character_array_constructor.f90: New test.
+
2017-11-08 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* gcc.target/aarch64/store_v2vec_lanes.c: New test.
diff --git a/gcc/testsuite/gfortran.dg/hollerith_character_array_constructor.f90 b/gcc/testsuite/gfortran.dg/hollerith_character_array_constructor.f90
new file mode 100644
index 0000000..086d46e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/hollerith_character_array_constructor.f90
@@ -0,0 +1,11 @@
+! { dg-do run }
+! { dg-options "-w" }
+! PR fortran/82884
+! Original code contributed by Gerhard Steinmetz
+program p
+ character :: c(4) = [1h(, 1hi, 1h4, 1h)]
+ if (c(1) /= '(') call abort
+ if (c(2) /= 'i') call abort
+ if (c(3) /= '4') call abort
+ if (c(4) /= ')') call abort
+end