diff options
author | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-01-11 22:03:53 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-01-11 22:03:53 +0100 |
commit | da972c05f48637060ae3a3b121f99d1522413b82 (patch) | |
tree | 52b89022a5b5b913eb3ed34efd5c71cfade6bf23 /gcc/tree-inline.c | |
parent | b13091dd9dbabe7fde4b112c4bfb9be729493c16 (diff) | |
download | gcc-da972c05f48637060ae3a3b121f99d1522413b82.zip gcc-da972c05f48637060ae3a3b121f99d1522413b82.tar.gz gcc-da972c05f48637060ae3a3b121f99d1522413b82.tar.bz2 |
re PR middle-end/85956 (ICE in wide_int_to_tree_1, at tree.c:1549)
PR middle-end/85956
PR lto/88733
* tree-inline.h (struct copy_body_data): Add adjust_array_error_bounds
field.
* tree-inline.c (remap_type_1): Formatting fix. If TYPE_MAX_VALUE of
ARRAY_TYPE's TYPE_DOMAIN is newly error_mark_node, replace it with
a dummy "omp dummy var" variable if id->adjust_array_error_bounds.
* omp-low.c (new_omp_context): Set cb.adjust_array_error_bounds.
fortran/
* trans-openmp.c: Include attribs.h.
(gfc_walk_alloc_comps, gfc_omp_clause_linear_ctor): Handle
VAR_DECL max bound with "omp dummy var" attribute like NULL or
error_mark_node - recompute number of elts independently.
testsuite/
* c-c++-common/gomp/pr85956.c: New test.
* g++.dg/gomp/pr88733.C: New test.
From-SVN: r267858
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 75d1df1..8862077 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -523,11 +523,27 @@ remap_type_1 (tree type, copy_body_data *id) if (TYPE_MAIN_VARIANT (new_tree) != new_tree) { - gcc_checking_assert (TYPE_DOMAIN (type) == TYPE_DOMAIN (TYPE_MAIN_VARIANT (type))); + gcc_checking_assert (TYPE_DOMAIN (type) + == TYPE_DOMAIN (TYPE_MAIN_VARIANT (type))); TYPE_DOMAIN (new_tree) = TYPE_DOMAIN (TYPE_MAIN_VARIANT (new_tree)); } else - TYPE_DOMAIN (new_tree) = remap_type (TYPE_DOMAIN (new_tree), id); + { + TYPE_DOMAIN (new_tree) = remap_type (TYPE_DOMAIN (new_tree), id); + /* For array bounds where we have decided not to copy over the bounds + variable which isn't used in OpenMP/OpenACC region, change them to + an uninitialized VAR_DECL temporary. */ + if (TYPE_MAX_VALUE (TYPE_DOMAIN (new_tree)) == error_mark_node + && id->adjust_array_error_bounds + && TYPE_MAX_VALUE (TYPE_DOMAIN (type)) != error_mark_node) + { + tree v = create_tmp_var (TREE_TYPE (TYPE_DOMAIN (new_tree))); + DECL_ATTRIBUTES (v) + = tree_cons (get_identifier ("omp dummy var"), NULL_TREE, + DECL_ATTRIBUTES (v)); + TYPE_MAX_VALUE (TYPE_DOMAIN (new_tree)) = v; + } + } break; case RECORD_TYPE: |