diff options
author | Roger Sayle <roger@eyesopen.com> | 2003-01-23 02:57:26 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2003-01-23 02:57:26 +0000 |
commit | 34ee7f8278d155d6d128f6af19b10ed35fa8f3d5 (patch) | |
tree | e350e7cda96af13a3c7a7347f5f121cef549541c /gcc/toplev.c | |
parent | 94edc4abdc1de8d0c77421354eabf3bfc3de0c91 (diff) | |
download | gcc-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/toplev.c')
-rw-r--r-- | gcc/toplev.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c index 80ddd8e..b24da96 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -621,10 +621,6 @@ int flag_volatile_static; int flag_syntax_only = 0; -/* Nonzero means perform global cse. */ - -static int flag_gcse; - /* Nonzero means perform loop optimizer. */ static int flag_loop_optimize; @@ -646,6 +642,10 @@ static int flag_if_conversion2; static int flag_delete_null_pointer_checks; +/* Nonzero means perform global CSE. */ + +int flag_gcse = 0; + /* Nonzero means to do the enhanced load motion during gcse, which trys to hoist loads by not killing them when a store to the same location is seen. */ @@ -2921,6 +2921,9 @@ rest_of_compilation (decl) #endif } + /* Instantiate any remaining CONSTANT_P_RTX nodes. */ + purge_builtin_constant_p (); + /* Move constant computations out of loops. */ if (optimize > 0 && flag_loop_optimize) |