Commit 0dcd3840 by Richard Henderson Committed by Richard Henderson

builtins.c (expand_builtin_constant_p): Check cse_not_expected here, (fold_builtin_constant_p) ...

        * builtins.c (expand_builtin_constant_p): Check cse_not_expected here,
        (fold_builtin_constant_p) ... not here.

From-SVN: r70926
parent 4b1e44be
2003-08-29 Richard Henderson <rth@redhat.com> 2003-08-29 Richard Henderson <rth@redhat.com>
* builtins.c (expand_builtin_constant_p): Check cse_not_expected here,
(fold_builtin_constant_p) ... not here.
2003-08-29 Richard Henderson <rth@redhat.com>
* c-tree.h (C_DECL_FILE_SCOPE): Move ... * c-tree.h (C_DECL_FILE_SCOPE): Move ...
* tree.h (DECL_FILE_SCOPE_P): ... here, and rename. * tree.h (DECL_FILE_SCOPE_P): ... here, and rename.
* c-decl.c, c-objc-common.c, c-typeck.c: Update to match. * c-decl.c, c-objc-common.c, c-typeck.c: Update to match.
......
...@@ -1462,7 +1462,11 @@ expand_builtin_constant_p (tree arglist, enum machine_mode target_mode) ...@@ -1462,7 +1462,11 @@ expand_builtin_constant_p (tree arglist, enum machine_mode target_mode)
/* We have taken care of the easy cases during constant folding. This /* We have taken care of the easy cases during constant folding. This
case is not obvious, so emit (constant_p_rtx (ARGLIST)) and let CSE case is not obvious, so emit (constant_p_rtx (ARGLIST)) and let CSE
get a chance to see if it can deduce whether ARGLIST is constant. */ get a chance to see if it can deduce whether ARGLIST is constant.
If CSE isn't going to run, of course, don't bother waiting. */
if (cse_not_expected)
return const0_rtx;
current_function_calls_constant_p = 1; current_function_calls_constant_p = 1;
...@@ -5470,15 +5474,14 @@ fold_builtin_constant_p (tree arglist) ...@@ -5470,15 +5474,14 @@ fold_builtin_constant_p (tree arglist)
&& TREE_CODE (TREE_OPERAND (arglist, 0)) == STRING_CST)) && TREE_CODE (TREE_OPERAND (arglist, 0)) == STRING_CST))
return integer_one_node; return integer_one_node;
/* If we aren't going to be running CSE or this expression /* If this expression has side effects, show we don't know it to be a
has side effects, show we don't know it to be a constant. constant. Likewise if it's a pointer or aggregate type since in
Likewise if it's a pointer or aggregate type since in those those case we only want literals, since those are only optimized
case we only want literals, since those are only optimized
when generating RTL, not later. when generating RTL, not later.
And finally, if we are compiling an initializer, not code, we And finally, if we are compiling an initializer, not code, we
need to return a definite result now; there's not going to be any need to return a definite result now; there's not going to be any
more optimization done. */ more optimization done. */
if (TREE_SIDE_EFFECTS (arglist) || cse_not_expected if (TREE_SIDE_EFFECTS (arglist)
|| AGGREGATE_TYPE_P (TREE_TYPE (arglist)) || AGGREGATE_TYPE_P (TREE_TYPE (arglist))
|| POINTER_TYPE_P (TREE_TYPE (arglist)) || POINTER_TYPE_P (TREE_TYPE (arglist))
|| cfun == 0) || cfun == 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment