This is the mail archive of the 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]

Re: [3.3 PATCH] Fix PR optimization/11841

Eric Botcazou <> writes:

| Hi,
| This is a regression present on 3.3 branch at -O2 -funroll-loops on x86, 
| caused by a bad interaction between GCSE and the (old) unroller.
| GCSE does a somewhat awful job in that we end up with only the following 2 
| insns referencing pseudo 63:
| (insn 118 78 36 2 (nil) (set (reg:SI 63)
|         (reg:SI 69)) 38 {*movsi_1} (nil)
|     (expr_list:REG_EQUAL (mem/f:SI (symbol_ref:SI ("i")) [3 i+0 S4 A32])
|         (nil))
| (insn 54 121 98 3 0x401772ec (set (mem/f:SI (symbol_ref:SI ("i")) [3 i+0 S4 
| A32])
|         (reg:SI 66)) 38 {*movsi_1} (nil)
|     (expr_list:REG_EQUAL (plus:SI (reg:SI 63)
|             (const_int 1 [0x1]))
|         (nil)))
| AFAICS, the RTL is correct at this point, albeit clearly pathological.  Then 
| the unroller wants to unroll the inner loop and marks pseudo 63 as local to 
| the loop, while the REG_EQUAL note is outside the loop.  So pseudo 63 is 
| replaced by per-unrolled-loop bivs and we end up with a dangling REG_EQUAL 
| note.  It is then rematerialized by CSE2 and all hell breaks loose.
| The proposed fix is to teach the unroller to look at notes when deciding 
| whether a pseudo is local.  Bootstrapped/regtested on i586-redhat-linux-gnu 
| (3.3 branch).  OK for that branch?

I was waiting for the outcome of your conversation with Richard G.
It looks like that this patch won't resolve optimization/13653.  But
this is already a good step forward.  So, yes, this patch is OK for

-- Gaby

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