diff options
author | Jason Merrill <jason@redhat.com> | 2016-07-25 14:32:13 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2016-07-25 14:32:13 -0400 |
commit | 5ec2cd9f666a8d26ce62ee7ef6383948fafb1b35 (patch) | |
tree | 4aaebb6731b4983f7f2b22d47f9f80c7612eae01 /gcc/cp/cp-gimplify.c | |
parent | fd2bfee51ee9b63869652ed0812df1d34aaca093 (diff) | |
download | gcc-5ec2cd9f666a8d26ce62ee7ef6383948fafb1b35.zip gcc-5ec2cd9f666a8d26ce62ee7ef6383948fafb1b35.tar.gz gcc-5ec2cd9f666a8d26ce62ee7ef6383948fafb1b35.tar.bz2 |
PR c++/65970 - constexpr infinite loop
gcc/c-family/
* c.opt (fconstexpr-loop-limit): New.
gcc/cp/
* constexpr.c (cxx_eval_loop_expr): Count iterations.
* cp-gimplify.c (genericize_cp_loop): Use start_locus even for
infinite loops.
From-SVN: r238730
Diffstat (limited to 'gcc/cp/cp-gimplify.c')
-rw-r--r-- | gcc/cp/cp-gimplify.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c index 59953a6..d9f7cea 100644 --- a/gcc/cp/cp-gimplify.c +++ b/gcc/cp/cp-gimplify.c @@ -264,14 +264,7 @@ genericize_cp_loop (tree *stmt_p, location_t start_locus, tree cond, tree body, loop = stmt_list; } else - { - location_t loc = start_locus; - if (!cond || integer_nonzerop (cond)) - loc = EXPR_LOCATION (expr_first (body)); - if (loc == UNKNOWN_LOCATION) - loc = start_locus; - loop = build1_loc (loc, LOOP_EXPR, void_type_node, stmt_list); - } + loop = build1_loc (start_locus, LOOP_EXPR, void_type_node, stmt_list); stmt_list = NULL; append_to_statement_list (loop, &stmt_list); |