aboutsummaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2003-01-23 02:57:26 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2003-01-23 02:57:26 +0000
commit34ee7f8278d155d6d128f6af19b10ed35fa8f3d5 (patch)
treee350e7cda96af13a3c7a7347f5f121cef549541c /gcc/simplify-rtx.c
parent94edc4abdc1de8d0c77421354eabf3bfc3de0c91 (diff)
downloadgcc-34ee7f8278d155d6d128f6af19b10ed35fa8f3d5.zip
gcc-34ee7f8278d155d6d128f6af19b10ed35fa8f3d5.tar.gz
gcc-34ee7f8278d155d6d128f6af19b10ed35fa8f3d5.tar.bz2
re PR rtl-optimization/8423 (CSE1 not propagating __builtin_constant_p enough)
PR optimization/8423 * cse.c (fold_rtx): Only eliminate a CONSTANT_P_RTX to 1 when its argument is constant, or 0 if !flag_gcse. * simplify-rtx.c (simplify_rtx): Convert CONSTANT_P_RTX to 1 if it's argument is constant. * gcse.c (want_to_gcse_p): Ignore CONSTANT_P_RTX nodes. (hash_scan_set): Don't record CONSTANT_P_RTX expressions. (do_local_cprop): Don't propagate CONSTANT_P_RTX constants. * builtins.c (purge_builtin_constant_p): New function to force instantiation of any remaining CONSTANT_P_RTX nodes. * rtl.h (purge_builtin_constant_p): Prototype here. * toplev.c (rest_of_compilation): Invoke purge_builtin_constant_p pass after GCSE and before loop. (flag_gcse): No longer static. * flags.h (flag_gcse): Prototype here. From-SVN: r61642
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 1949f24..b0ddb65 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -1,6 +1,6 @@
/* RTL simplification functions for GNU compiler.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@@ -2729,11 +2729,15 @@ simplify_rtx (x)
: GET_MODE (XEXP (x, 1))),
XEXP (x, 0), XEXP (x, 1));
case 'x':
- /* The only case we try to handle is a SUBREG. */
if (code == SUBREG)
return simplify_gen_subreg (mode, SUBREG_REG (x),
GET_MODE (SUBREG_REG (x)),
SUBREG_BYTE (x));
+ if (code == CONSTANT_P_RTX)
+ {
+ if (CONSTANT_P (XEXP (x,0)))
+ return const1_rtx;
+ }
return NULL;
default:
return NULL;