[RFC] Fix PR rtl-optimization/33732

Paolo Bonzini paolo.bonzini@lu.unisi.ch
Thu Nov 8 09:21:00 GMT 2007


As Kenny said, I am quite weary of adding a dataflow scan in the middle 
of reload (and I would not like to add another full scan after sweating 
to remove full scans from passes before reload!).

I didn't understand if the fixes you proposed are "interesting" even 
without adding the additional scan.  Even if they are not, they might be 
real bugs, so we may consider them for next stage1.

>    I can see a few ways to fix this:
> 

What about...

> 1) Pass NULL for LOC to df_ref_create_structure().

... only if it "would be a bad idea to use DF_REF_REAL_LOC"? As in:

  rtx *ref_loc;
  rtx *real_loc = REG_P (*loc) ? loc : &SUBREG_REG (*loc);
  if (GET_MODE (*real_loc) != GET_MODE (regno_reg_rtx[i]))
    ref_loc = loc;
  else
    ref_loc = NULL;

  ref = df_ref_create_structure (collection_rec, regno_reg_rtx[i],
                                 ref_loc, bb, insn, ref_type, ref_flags);

You also do the HARD_REGISTER_P check in the right place (this part of 
df-scan is only run for hard regs).

> 2) Pass &regno_reg_rtx[i] for LOC to df_ref_create_structure().

No, this is wrong.  Some passes may modify RTL using loc.

> 3) Don't use DF_REF_REAL_LOC(use) if it looks like a bad idea.

You should also do it in df_create_unused_note then.

Paolo



More information about the Gcc-patches mailing list