This is the mail archive of the
mailing list for the GCC project.
[patch] cse.c: Remove an optimization that never triggers.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Cc: dave dot anglin at nrc dot ca, law at redhat dot com
- Date: Fri, 28 Jan 2005 07:47:06 -0500 (EST)
- Subject: [patch] cse.c: Remove an optimization that never triggers.
Attached is a patch to remove an optimization that never triggers.
The condition of the "if" statement that this patch is removing is
never true during bootstrap and make-check of i686-pc-linux-gnu and
Plus, even if this optimization triggered, this would be
simplification of a control-flow instruction based on no information
except that from INSN itself, which sounds like a CFG cleanup's job.
The patch removes the optimization and teaches fold_rtx to return X
early if PC is passed. Note that the rest of fold_rtx never deals
According to CVS (both the current one and old-gcc), this optimization
is hardly ever touched except when somebody is sweeping through the
whole GCC to make mechanical changes.
Tested on i686-pc-linux-gnu. OK to apply?
2005-01-27 Kazu Hirata <email@example.com>
* cse.c (fold_rtx) <PC>: Don't optimize.
RCS file: /cvs/gcc/gcc/gcc/cse.c,v
retrieving revision 1.332
diff -u -d -p -r1.332 cse.c
--- cse.c 26 Jan 2005 12:44:58 -0000 1.332
+++ cse.c 27 Jan 2005 12:48:56 -0000
@@ -3253,6 +3253,7 @@ fold_rtx (rtx x, rtx insn)
+ case PC:
/* No use simplifying an EXPR_LIST
since they are used only for lists of args
in a function call's REG_EQUAL note. */
@@ -3264,17 +3265,6 @@ fold_rtx (rtx x, rtx insn)
- case PC:
- /* If the next insn is a CODE_LABEL followed by a jump table,
- PC's value is a LABEL_REF pointing to that label. That
- lets us fold switch statements on the VAX. */
- rtx next;
- if (insn && tablejump_p (insn, &next, NULL))
- return gen_rtx_LABEL_REF (Pmode, next);
/* See if we previously assigned a constant value to this SUBREG. */
if ((new = lookup_as_function (x, CONST_INT)) != 0