summaryrefslogtreecommitdiff
path: root/gcc/gcse.c
diff options
context:
space:
mode:
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-23 02:57:26 +0000
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-23 02:57:26 +0000
commitc7926a824cfe7ee75d14440282d6d15d83dcd6f8 (patch)
treee350e7cda96af13a3c7a7347f5f121cef549541c /gcc/gcse.c
parent45baea8bdc127498d928bff521be446e7d595dff (diff)
downloadgcc-c7926a824cfe7ee75d14440282d6d15d83dcd6f8.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61642 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r--gcc/gcse.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 3fdf47e97a5..21719948f5b 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -1305,6 +1305,7 @@ want_to_gcse_p (x)
case CONST_DOUBLE:
case CONST_VECTOR:
case CALL:
+ case CONSTANT_P_RTX:
return 0;
default:
@@ -2216,7 +2217,8 @@ hash_scan_set (pat, insn, table)
&& REGNO (src) >= FIRST_PSEUDO_REGISTER
&& can_copy_p [GET_MODE (dest)]
&& REGNO (src) != regno)
- || CONSTANT_P (src))
+ || (CONSTANT_P (src)
+ && GET_CODE (src) != CONSTANT_P_RTX))
/* A copy is not available if its src or dest is subsequently
modified. Here we want to search from INSN+1 on, but
oprs_available_p searches from INSN on. */
@@ -4277,7 +4279,8 @@ do_local_cprop (x, insn, alter_jumps, libcall_sp)
if (l->in_libcall)
continue;
- if (CONSTANT_P (this_rtx))
+ if (CONSTANT_P (this_rtx)
+ && GET_CODE (this_rtx) != CONSTANT_P_RTX)
newcnst = this_rtx;
if (REG_P (this_rtx) && REGNO (this_rtx) >= FIRST_PSEUDO_REGISTER
/* Don't copy propagate if it has attached REG_EQUIV note.