Make cselib COND_EXEC-safe
From-SVN: r44713
This commit is contained in:
parent
674fc07da0
commit
b7933c21dc
@ -1,3 +1,8 @@
|
||||
2001-08-08 Bernd Schmidt <bernds@redhat.com>
|
||||
|
||||
* cselib.c (cselib_record_sets): If insn is predicated, turn
|
||||
sources into IF_THEN_ELSEs.
|
||||
|
||||
2001-08-08 Graham Stott <grahams@redhat.com>
|
||||
|
||||
* final.c (shorten_branches): Update the INSN_ADDRESSES of insns
|
||||
|
10
gcc/cselib.c
10
gcc/cselib.c
@ -1179,8 +1179,15 @@ cselib_record_sets (insn)
|
||||
int i;
|
||||
struct set sets[MAX_SETS];
|
||||
rtx body = PATTERN (insn);
|
||||
rtx cond = 0;
|
||||
|
||||
body = PATTERN (insn);
|
||||
if (GET_CODE (body) == COND_EXEC)
|
||||
{
|
||||
cond = COND_EXEC_TEST (body);
|
||||
body = COND_EXEC_CODE (body);
|
||||
}
|
||||
|
||||
/* Find all sets. */
|
||||
if (GET_CODE (body) == SET)
|
||||
{
|
||||
@ -1219,6 +1226,9 @@ cselib_record_sets (insn)
|
||||
/* We don't know how to record anything but REG or MEM. */
|
||||
if (GET_CODE (dest) == REG || GET_CODE (dest) == MEM)
|
||||
{
|
||||
rtx src = sets[i].src;
|
||||
if (cond)
|
||||
src = gen_rtx_IF_THEN_ELSE (GET_MODE (src), cond, src, dest);
|
||||
sets[i].src_elt = cselib_lookup (sets[i].src, GET_MODE (dest), 1);
|
||||
if (GET_CODE (dest) == MEM)
|
||||
sets[i].dest_addr_elt = cselib_lookup (XEXP (dest, 0), Pmode, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user