From 34ee7f8278d155d6d128f6af19b10ed35fa8f3d5 Mon Sep 17 00:00:00 2001 From: Roger Sayle Date: Thu, 23 Jan 2003 02:57:26 +0000 Subject: 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 --- gcc/toplev.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'gcc/toplev.c') 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) -- cgit v1.1