This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Avoid ICEing for partial defs in loop-iv.c (PR32405)


Hello,

given code like

set (subreg:si REG:di) (something:si)

loop-iv gets confused and believes that DImode register is assigned
SImode value.  I am not sure why this did not happen before df branch
merge, probably we produced different ud-chains -- for

set (subreg:si REG:di 0) (something:si)
set (subreg:si REG:di 4) (something:si)
use (REG:di)

we probably had ud-edges to both insns that define REG, while now we
have edge only to the later one; or something like that.

Anyway, the patch below makes us fail for partial defs.  Bootstrapped &
regtested on i686, commited.

Zdenek

	PR rtl-optimization/32405
	* loop-iv.c (iv_get_reaching_def): Fail for partial defs.

Index: loop-iv.c
===================================================================
*** loop-iv.c	(revision 125863)
--- loop-iv.c	(working copy)
*************** iv_get_reaching_def (rtx insn, rtx reg, 
*** 347,352 ****
--- 347,357 ----
      return GRD_INVALID;
  
    adef = DF_REF_CHAIN (use)->ref;
+ 
+   /* We do not handle setting only part of the register.  */
+   if (adef->flags & DF_REF_READ_WRITE)
+     return GRD_INVALID;
+ 
    def_insn = DF_REF_INSN (adef);
    def_bb = DF_REF_BB (adef);
    use_bb = BLOCK_FOR_INSN (insn);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]