summaryrefslogtreecommitdiff
path: root/gcc/gcse.c
diff options
context:
space:
mode:
authordanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-25 00:58:28 +0000
committerdanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-25 00:58:28 +0000
commit48691de1b4f8be6c520d1ec16c65a4f2fcf5ddb0 (patch)
treed187c59aebf3efeb9af07a85e938b7f451cd074a /gcc/gcse.c
parent07e929030d44a0ca40fdd879853c733bf53ca32d (diff)
downloadgcc-48691de1b4f8be6c520d1ec16c65a4f2fcf5ddb0.tar.gz
PR opt/8705
* gcse.c (try_replace_reg): On a successful substitution of a constant into a single set, try to simplify the source of the set. * loop.c (scan_loop): Don't try to optimize a MODE_CC set with a constant source. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66060 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r--gcc/gcse.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 528aaca9980..db2fb57ff21 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -3963,6 +3963,15 @@ try_replace_reg (from, to, insn)
if (num_changes_pending () && apply_change_group ())
success = 1;
+ /* Try to simplify SET_SRC if we have substituted a constant. */
+ if (success && set && CONSTANT_P (to))
+ {
+ src = simplify_rtx (SET_SRC (set));
+
+ if (src)
+ validate_change (insn, &SET_SRC (set), src, 0);
+ }
+
if (!success && set && reg_mentioned_p (from, SET_SRC (set)))
{
/* If above failed and this is a single set, try to simplify the source of