This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Jump optimization
- To: gcc2 at cygnus dot com, egcs at cygnus dot com
- Subject: Jump optimization
- From: "Michael P. Hayes" <michaelh at ongaonga dot chch dot cri dot nz>
- Date: Sat, 25 Oct 1997 12:30:52 +1300
Somewhere along the line (after gcc2.7.2) the check for modified_in_p
was removed from the test in jump.c that looked to convert
if (...) x = exp into t = exp; if (xxx) x = t;
Does anybody know why this was removed (there is no ChangeLog entry)
and why modified_in_p was also changed? Without this test, jump
optimization for the C4x port does nasty things...
Index: jump.c
===================================================================
RCS file: /usr/local/src/cvsroot/gnu/gcc2/jump.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 jump.c
*** jump.c 1997/09/25 00:42:39 1.1.1.1
--- jump.c 1997/10/24 22:54:33
***************
*** 997,1002 ****
--- 997,1003 ----
&& GET_CODE (SET_SRC (temp1)) != REG
&& GET_CODE (SET_SRC (temp1)) != SUBREG
&& GET_CODE (SET_SRC (temp1)) != CONST_INT
+ && ! modified_in_p (insn, temp)
&& ! side_effects_p (SET_SRC (temp1))
&& ! may_trap_p (SET_SRC (temp1))
&& rtx_cost (SET_SRC (temp1), SET) < 10)
Index: rtlanal.c
===================================================================
RCS file: /usr/local/src/cvsroot/gnu/gcc2/rtlanal.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 rtlanal.c
*** rtlanal.c 1997/09/25 00:42:41 1.1.1.1
--- rtlanal.c 1997/10/24 23:18:39
***************
*** 560,569 ****
rtx x;
rtx insn;
{
! enum rtx_code code = GET_CODE (x);
char *fmt;
int i, j;
switch (code)
{
case CONST_INT:
--- 560,573 ----
rtx x;
rtx insn;
{
! enum rtx_code code;
char *fmt;
int i, j;
+ if (!x)
+ return 0;
+
+ code = GET_CODE (x);
switch (code)
{
case CONST_INT: