aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2019-06-24 23:13:12 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2019-06-24 21:13:12 +0000
commitf4af4019dfb79f92adcf7cee4ef9e5f6ff428a37 (patch)
tree2344514a98c3312cba34b09afe63f6f1962da351 /gcc/fortran
parentcd57f4d81bdefeca6133dc52db8b7832a867686b (diff)
downloadgcc-f4af4019dfb79f92adcf7cee4ef9e5f6ff428a37.zip
gcc-f4af4019dfb79f92adcf7cee4ef9e5f6ff428a37.tar.gz
gcc-f4af4019dfb79f92adcf7cee4ef9e5f6ff428a37.tar.bz2
ipa-utils.h (type_with_linkage_p): Verify that type is CXX_ODR_P.
* ipa-utils.h (type_with_linkage_p): Verify that type is CXX_ODR_P. (odr_type_p): Remove extra return. * lto-streamer-out.c (hash_tree): Hash TYPE_CXX_ODR_P; hash STRING_FLAG only for arrays and integers. * tree-stremaer-in.c (unpack_ts_type_common_value_fields): Update analogously. * tree-streamer-out.c (pack_ts_type_common_value_fields): Likewise. * print-tree.c (print_node): Print cxx-odr-p and string-flag. * tree.c (need_assembler_name_p): Also check that type is CXX_ODR_TYPE_P (verify_type_variant): Update verification of SRING_FLAG; also check CXX_ODR_P. * tree.h (ARRAY_OR_INTEGER_TYPE_CHECK): New macro. (TYPE_STRING_FLAG): Use it. (TYPE_CXX_ODR_P): New macro. * lto-common.c (compare_tree_sccs_1): Compare CXX_ODR_P; compare STRING_FLAG only for arrays and integers. * gcc-interface/decl.c (gnat_to_gnu_entity): Check that type is array or integer prior checking string flag. * gcc-interface/gigi.h (gnat_signed_type_for, maybe_character_value): Likewise. * c-common.c (braced_lists_to_strings): Check that type is array or integer prior checking string flag. * lex.c (cxx_make_type): Set TYPE_CXX_ODR_P. * dwarf2out.c (gen_array_type_die): First check that type is an array and then test string flag. * trans-expr.c (gfc_conv_substring): Check that type is array or integer prior checking string flag. (gfc_conv_string_parameter): Likewise. * trans-openmp.c (gfc_omp_scalar_p): Likewise. * trans.c (gfc_build_array_ref): Likewise. From-SVN: r272628
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog8
-rw-r--r--gcc/fortran/trans-expr.c8
-rw-r--r--gcc/fortran/trans-openmp.c3
-rw-r--r--gcc/fortran/trans.c3
4 files changed, 18 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 6489a04..f70aaa6 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,11 @@
+2019-06-24 Jan Hubicka <jh@suse.cz>
+
+ * trans-expr.c (gfc_conv_substring): Check that
+ type is array or integer prior checking string flag.
+ (gfc_conv_string_parameter): Likewise.
+ * trans-openmp.c (gfc_omp_scalar_p): Likewise.
+ * trans.c (gfc_build_array_ref): Likewise.
+
2019-06-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/89782
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index dc173a0..074568a 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -2309,7 +2309,9 @@ gfc_conv_substring (gfc_se * se, gfc_ref * ref, int kind,
start.expr = gfc_evaluate_now (start.expr, &se->pre);
/* Change the start of the string. */
- if (TYPE_STRING_FLAG (TREE_TYPE (se->expr)))
+ if ((TREE_CODE (TREE_TYPE (se->expr)) == ARRAY_TYPE
+ || TREE_CODE (TREE_TYPE (se->expr)) == INTEGER_TYPE)
+ && TYPE_STRING_FLAG (TREE_TYPE (se->expr)))
tmp = se->expr;
else
tmp = build_fold_indirect_ref_loc (input_location,
@@ -9479,7 +9481,9 @@ gfc_conv_string_parameter (gfc_se * se)
return;
}
- if (TYPE_STRING_FLAG (TREE_TYPE (se->expr)))
+ if ((TREE_CODE (TREE_TYPE (se->expr)) == ARRAY_TYPE
+ || TREE_CODE (TREE_TYPE (se->expr)) == INTEGER_TYPE)
+ && TYPE_STRING_FLAG (TREE_TYPE (se->expr)))
{
if (TREE_CODE (se->expr) != INDIRECT_REF)
{
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index 0eb5956..394cbc2 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -1222,7 +1222,8 @@ gfc_omp_scalar_p (tree decl)
|| GFC_CLASS_TYPE_P (type))
return false;
}
- if (TYPE_STRING_FLAG (type))
+ if ((TREE_CODE (type) == ARRAY_TYPE || TREE_CODE (type) == INTEGER_TYPE)
+ && TYPE_STRING_FLAG (type))
return false;
if (INTEGRAL_TYPE_P (type)
|| SCALAR_FLOAT_TYPE_P (type)
diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c
index e7844c9..0d786d9 100644
--- a/gcc/fortran/trans.c
+++ b/gcc/fortran/trans.c
@@ -418,7 +418,8 @@ gfc_build_array_ref (tree base, tree offset, tree decl, tree vptr)
tmp = gfc_build_addr_expr (pvoid_type_node, base);
tmp = fold_build_pointer_plus_loc (input_location, tmp, offset);
tmp = fold_convert (build_pointer_type (type), tmp);
- if (!TYPE_STRING_FLAG (type))
+ if ((TREE_CODE (type) != INTEGER_TYPE && TREE_CODE (type) != ARRAY_TYPE)
+ || !TYPE_STRING_FLAG (type))
tmp = build_fold_indirect_ref_loc (input_location, tmp);
return tmp;
}