summaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2003-02-05 22:37:54 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2003-02-05 22:37:54 +0000
commit8f4be2be97089ba0dc22ed55ee33d90e237b8c1e (patch)
treee14ea46575bce454a67edbb9d6bc03000c970bcd /gcc/fold-const.c
parent3b51cb387e3c601a6663f518b402c09c6b69eeb5 (diff)
downloadgcc-8f4be2be97089ba0dc22ed55ee33d90e237b8c1e.tar.gz
* defaults.h (CLZ_DEFINED_VALUE_AT_ZERO): New.
(CTZ_DEFINED_VALUE_AT_ZERO): New. * doc/rtl.texi, doc/tm.texi: Document them. * combine.c (nonzero_bits) [CLZ, CTZ]: Handle the definedness of the value at zero properly. * fold-const.c (tree_expr_nonnegative_p): Likewise. * simplify-rtx.c (simplify_unary_operation): Likewise. * config/alpha/alpha.h (CLZ_DEFINED_VALUE_AT_ZERO): New. (CTZ_DEFINED_VALUE_AT_ZERO): New. * config/arm/arm.c (TARGET_INIT_BUILTINS): Remove. (TARGET_EXPAND_BUILTIN): Remove. (def_builtin, arm_init_builtins, arm_expand_builtin): Remove. * config/arm/arm.h (CLZ_DEFINED_VALUE_AT_ZERO): New. (enum arm_builtins): Remove. * config/arm/arm.md (UNSPEC_CLZ): Remove. (clzsi2): Rename from clz; use clz instead of unspec. (ctzsi2): New. * config/arm/arm-protos.h: Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@62453 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 55f4ce46c41..0e301a72690 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -7436,11 +7436,17 @@ tree_expr_nonnegative_p (t)
{
case ABS_EXPR:
case FFS_EXPR:
- case CLZ_EXPR:
- case CTZ_EXPR:
case POPCOUNT_EXPR:
case PARITY_EXPR:
return 1;
+
+ case CLZ_EXPR:
+ case CTZ_EXPR:
+ /* These are undefined at zero. This is true even if
+ C[LT]Z_DEFINED_VALUE_AT_ZERO is set, since what we're
+ computing here is a user-visible property. */
+ return 0;
+
case INTEGER_CST:
return tree_int_cst_sgn (t) >= 0;
case TRUNC_DIV_EXPR: