From 4e7d7b3d5d5cefd5e19a736a83c3077f7c95baad Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 3 Apr 2013 11:17:44 +0200 Subject: re PR c/19449 (__builtin_constant_p cannot resolve to const when optimizing) PR c/19449 * tree.h (force_folding_builtin_constant_p): New decl. * builtins.c (force_folding_builtin_constant_p): New variable. (fold_builtin_constant_p): Fold immediately also if force_folding_builtin_constant_p. * c-parser.c (c_parser_get_builtin_args): Add choose_expr_p argument. If set, or it temporarily for parsing of the first argument into force_folding_builtin_constant_p. (c_parser_postfix_expression): Adjust callers. * gcc.c-torture/execute/pr19449.c: New test. From-SVN: r197393 --- gcc/tree.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc/tree.h') diff --git a/gcc/tree.h b/gcc/tree.h index 985512a..f911459 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -5855,6 +5855,10 @@ fold_build_pointer_plus_hwi_loc (location_t loc, tree ptr, HOST_WIDE_INT off) fold_build_pointer_plus_hwi_loc (UNKNOWN_LOCATION, p, o) /* In builtins.c */ + +/* Non-zero if __builtin_constant_p should be folded right away. */ +extern bool force_folding_builtin_constant_p; + extern bool avoid_folding_inline_builtin (tree); extern tree fold_call_expr (location_t, tree, bool); extern tree fold_builtin_fputs (location_t, tree, tree, bool, bool, tree); -- cgit v1.1