"flags" was modified, leaving later calls to df_uses_record
to mark uses as DF_REF_READ_WRITE.
This lead to missing REG_DEAD note for such a use,
causing different views of live ranges
between forward-scanning (global, using REG_DEAD)
and backward-scanning (REG_N_CALLS_CROSSED, which is computed by
regstat_bb_compute_ri).
This inconsistent view lead to a call-clobbered hard register
to not have a save area, but later was attempted to be spilled
because a pseudo register that doesn't cross a live range got allocated to it
and the forward scanning in global thought that the pseudo reg
lives across the call.
Bootstrapped and regtested on ia64.
OK fo mainline ?
ChangeLog:
2007-06-14 Seongbae Park <seongbae.park@gmail.com>
PR rtl-optimization/32339
* df-scan.c (df_uses_record): Don't modify flags but just add to it for
df_ref_record.
--
#pragma ident "Seongbae Park, compiler, http://seongbae.blogspot.com"
Index: gcc/df-scan.c
===================================================================
--- gcc/df-scan.c (revision 125735)
+++ gcc/df-scan.c (working copy)
@@ -2982,9 +2982,9 @@ df_uses_record (struct df_collection_rec
case PRE_MODIFY:
case POST_MODIFY:
/* Catch the def of the register being modified. */
- flags |= DF_REF_READ_WRITE | DF_REF_PRE_POST_MODIFY;
df_ref_record (collection_rec, XEXP (x, 0), &XEXP (x, 0), bb, insn,
- DF_REF_REG_DEF, flags);
+ DF_REF_REG_DEF,
+ flags | DF_REF_READ_WRITE | DF_REF_PRE_POST_MODIFY);
/* ... Fall through to handle uses ... */