diff options
author | Jakub Jelinek <jakub@redhat.com> | 2015-09-09 09:25:53 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2015-09-09 09:25:53 +0200 |
commit | 6cbf37c3d58bd0dbd5f79c6b2e24b35764e6fb0a (patch) | |
tree | b8272989ec291c3130dc392e6d2ff3d1fce155f4 /gcc/cp | |
parent | 0bb99c1162085f10cb1706f61774e72b654e5279 (diff) | |
download | gcc-6cbf37c3d58bd0dbd5f79c6b2e24b35764e6fb0a.zip gcc-6cbf37c3d58bd0dbd5f79c6b2e24b35764e6fb0a.tar.gz gcc-6cbf37c3d58bd0dbd5f79c6b2e24b35764e6fb0a.tar.bz2 |
re PR c++/67504 (ICE with type dependent collapse argument)
PR c++/67504
* parser.c (cp_parser_omp_clause_collapse): Test tree_fits_shwi_p
before INTEGRAL_TYPE_P test.
* g++.dg/gomp/pr67504.C: New test.
From-SVN: r227579
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/parser.c | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3a412ae..515a1e8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2015-09-09 Jakub Jelinek <jakub@redhat.com> + + PR c++/67504 + * parser.c (cp_parser_omp_clause_collapse): Test tree_fits_shwi_p + before INTEGRAL_TYPE_P test. + 2015-09-08 Jason Merrill <jason@redhat.com> PR c++/67041 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 67fbcda..d96825b 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -29228,8 +29228,8 @@ cp_parser_omp_clause_collapse (cp_parser *parser, tree list, location_t location if (num == error_mark_node) return list; num = fold_non_dependent_expr (num); - if (!INTEGRAL_TYPE_P (TREE_TYPE (num)) - || !tree_fits_shwi_p (num) + if (!tree_fits_shwi_p (num) + || !INTEGRAL_TYPE_P (TREE_TYPE (num)) || (n = tree_to_shwi (num)) <= 0 || (int) n != n) { |