On 7/1/15 21:52, Bernd Schmidt wrote: > On 07/01/2015 03:04 AM, Chen Gang wrote: > >> For me, the more details are: >> >> - The insns have 2 loops which can be lsetup optimized. >> >> - After hwloop_optimize finishes 1st lsetup optimization, it generates >> new lsetup insn which appends to jump insn in the basic block (which >> causes the insns are not 'standard' but OK for code generation). > > The problem is that you can't append anything to a basic block after a jump. > You need to create a new one. This problem doesn't usually show up since > nothing ever looks at the basic block again, unless both directions from the > conditional branch happen to branch to lsetup candidate loops. >
OK, thanks. What you said sound reasonable to me. > Below is a patch. Can you test this with anything you have beyond the > testsuite? > It can fix this issue (Bug66620), let the insns standard, and can build the bfin kernel with allmodconfig successfully (although for bfin kernel members, they stick to allmodconfig is not a good idea for bfin kernel). It finished lsetup optimization for one loop, but still left the other ( get the same .s as my original fix). for 2nd times in hwloop_optimize, it return false. And welcome any additional ideas for it. For me, my original fix is incorrect: it still remains the insns in the incorrect state (although my fix can generate the correct .s, and can build bfin kernel with allmodconfig successfully). Thanks. -- Chen Gang Open, share, and attitude like air, water, and life which God blessed