[Bug rtl-optimization/56885] [4.8/4.9 Regression] ICE: in assign_by_spills, at lra-assigns.c:1268 with -O -fschedule-insns -fselective-scheduling

2014-02-04 Thread abel at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56885

Andrey Belevantsev abel at gcc dot gnu.org changed:

   What|Removed |Added

 CC||abel at gcc dot gnu.org

--- Comment #9 from Andrey Belevantsev abel at gcc dot gnu.org ---
Trunk does not ICE for me anymore, though the two insns Yuri mentioned are
still reordered.  I will explain what happens in more detail.

The selective scheduler supports register renaming.  So on seeing an
anti-dependence in this case for di=r69 it assumes that the RHS of this insn
can be moved up with the new register, e.g. r?? = r69 and later di = r??.  When
the new register is being chosen, there is nothing in the function that
prevents using the original register, di -- no liveness or hardware imposed
restrictions are reported by the backend so we allow to move the insn with the
original register.  The reason for this is that the dependence comes from the
implicit_set on the another insn (insn 30 in Yuri's dump), and implicit sets do
not get reflected in the dataflow information (which we get from DF_LIVE_IN
sets and df_simulate_one_insn_backwards interfaces).

Now, if the extra dependencies really come from the evaluation_hook interface
of the x86 backend, I'd note that the hook, originally implemented for ia64
only, was not intended for adding any new dependencies, but rather for
reflecting the dependencies added in the backend for its own purposes.  E.g.
for ia64 the interface allows to get the complete dependence picture before
making decisions on bundling.  So I'd claim that any dependencies created for
the scheduler should also be calculated via the general deps_analyze_insn
mechanism of sched-deps.c, with the correctly prepared deps context.  E.g. any
changes done with implicit_sets/clobbers/uses and IRA/LRA interfaces are also
visible within the selective scheduling.  The selective scheduling analyzes
dependencies between separate insns, not blocks, so the evaluation_hook
interface does not make sense for it.

To summarize, if the backend wants to stop reordering insns in question and
also forbid renaming, then this should be exposed from within a hook called
from sched-deps.c when calculating dependencies through deps_analyze_insn, not
later, and then we can judge whether the new dependence comes from
LHS/RHS/whole insn and make appropriate changes for renaming.  The current
interface does not tell us that renaming is prohibited and we cannot derive it
from the IR.  The best way would be to properly reflect all restrictions in the
IR and not end up lying to the dataflow machinery and the scheduler.


[Bug rtl-optimization/56885] [4.8/4.9 Regression] ICE: in assign_by_spills, at lra-assigns.c:1268 with -O -fschedule-insns -fselective-scheduling

2014-02-04 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56885

--- Comment #10 from H.J. Lu hjl.tools at gmail dot com ---
On trunk, it was fixed by r206938.


[Bug rtl-optimization/56885] [4.8/4.9 Regression] ICE: in assign_by_spills, at lra-assigns.c:1268 with -O -fschedule-insns -fselective-scheduling

2013-10-25 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56885

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P2


[Bug rtl-optimization/56885] [4.8/4.9 Regression] ICE: in assign_by_spills, at lra-assigns.c:1268 with -O -fschedule-insns -fselective-scheduling

2013-05-31 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56885

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|4.8.1   |4.8.2

--- Comment #7 from Jakub Jelinek jakub at gcc dot gnu.org ---
GCC 4.8.1 has been released.


[Bug rtl-optimization/56885] [4.8/4.9 Regression] ICE: in assign_by_spills, at lra-assigns.c:1268 with -O -fschedule-insns -fselective-scheduling

2013-04-09 Thread izamyatin at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56885



Igor Zamyatin izamyatin at gmail dot com changed:



   What|Removed |Added



 CC||ysrumyan at gmail dot com



--- Comment #4 from Igor Zamyatin izamyatin at gmail dot com 2013-04-09 
10:53:09 UTC ---

Adding the author of the changes that fix failures of pre-alloc scheduler


[Bug rtl-optimization/56885] [4.8/4.9 Regression] ICE: in assign_by_spills, at lra-assigns.c:1268 with -O -fschedule-insns -fselective-scheduling

2013-04-09 Thread ysrumyan at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56885



--- Comment #5 from Yuri Rumyantsev ysrumyan at gmail dot com 2013-04-09 
13:33:53 UTC ---

I did simple investigation and found out that

1. Test is compiled successfully without selective scheduling, i.e. with

'-fschedule-insns' only.

2. The problem is that selective scheduler moves function argument (off) uo

through bunch of instructions correspondent to __builtin_memset() ignoring

dependency creating by ix86_dependencies_evaluation_hook() ( i tried to add

output dependency instead of anti dependency between them but it also did not

help). More precisely, we have the following sequence of insns:



(insn 30 29 31 5 (parallel [

(set (reg:DI 77)

(const_int 0 [0]))

(set (reg/f:DI 75 [ D.1742 ])

(plus:DI (reg/f:DI 74 [ D.1742 ])

(reg:DI 77)))

(set (mem:BLK (reg/f:DI 74 [ D.1742 ]) [0 MEM[(void *)_17]+0 S15

A8])

(const_int 0 [0]))

(use (reg:QI 78))

(use (reg:DI 77))

]) t.c:16 909 {*rep_stosqi}

 (expr_list:REG_DEAD (reg/f:DI 74 [ D.1742 ])

(expr_list:REG_UNUSED (reg:DI 77)

(expr_list:REG_UNUSED (reg/f:DI 75 [ D.1742 ])

(nil)

(insn 31 30 32 5 (set (reg:SI 5 di)

(subreg:SI (reg:DI 69 [ ivtmp.3 ]) 0)) t.c:17 85 {*movsi_internal}

 (nil))

(call_insn 32 31 33 5 (call (mem:QI (symbol_ref:DI (bar) [flags 0x41] 

function_decl 0x7f66061e4900 bar) [0 bar S1 A8])

(const_int 0 [0])) t.c:17 646 {*call}

 (expr_list:REG_DEAD (reg:SI 5 di)

(nil))

(expr_list:REG_BR_PRED (use (reg:SI 5 di))

(nil)))



and there exist anti or output dependency between 30 and 31 insns created by

ix86-hook which is ignored by selective scheduler:



Moving [((31;di=r69#0;)type:set;count:2;)prio:3;orig_bb:5;] through 30:

unchanged (as RHS)



So I assume that selective scheduler needs to be tuned to be invoked before

Register Allocation phase on x86.


[Bug rtl-optimization/56885] [4.8/4.9 Regression] ICE: in assign_by_spills, at lra-assigns.c:1268 with -O -fschedule-insns -fselective-scheduling

2013-04-09 Thread ysrumyan at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56885



--- Comment #6 from Yuri Rumyantsev ysrumyan at gmail dot com 2013-04-09 
14:22:28 UTC ---

Forgot to mention that __builtin_memset and function argument are not

interchangeable since both use the same register di.