Fix modulo-scheduler -fcompare-debug issues

Jeff Law law@redhat.com
Thu Mar 12 03:17:07 GMT 2020


On Tue, 2020-03-10 at 19:39 +0300, Roman Zhuykov wrote:
> Hi!
> 
> Current modulo-sched implementation is a bit faulty from -fcompile-debug
> perspective.
> 
> I found that few years ago, the most simple example is pr42631.c which fails
> (with just -fmodulo-sched or together with -fmodulo-sched-allow-regmoves) on
> powerpc64le with at least any gcc-4.9 or newer compiler.
> I've investigated that difference about 3 years ago, it is mostly technical,
> dumps shows there are some "flying" NOTE_INSN_DELETED items.
> I understood that it is minor, and I planned to commit the fix only when my
> other modulo-sched stuff will be ready.
> 
> But right now I see that when I enable -fmodulo-sched by default, powerpc64le
> bootstrap give comparison failure as of r10-7056.
> 
> Comparing stages 2 and 3
> Bootstrap comparison failure!
> gcc/ggc-page.o differs
> 
> That doesn't happen on released branches, so it is a kind of "regression"
> (certainly, nobody runs bootstrap with -fmodulo-sched).
> 
> Is that a good reason to commit the patch right now in stage4?
> 
> Patch was successfully regstrapped (based on r10-7056) using x86_64 and
> powerpc64le, both with default options and with -fmodulo-sched enabled.
> 
> Roman
> 
> --
> modulo-sched: fix compare-debug issues
>     
> This patch fixes bootstrap comparison failure on powerpc64le when running it
> with -fmodulo-sched enabled.
>     
> When applying the schedule we have to move debug insns in the same
> way as we move note insns.  Also we have to discard adding debug insns
> to SCCs in DDG graph.
>     
> 20YY-MM-DD  Roman Zhuykov  <zhroma@ispras.ru>
>    
> 	* ddg.c (create_ddg_dep_from_intra_loop_link): Adjust assertions.
> 	(create_ddg_dep_no_link): Likewise.
> 	(add_inter_loop_mem_dep): Do not create "debug --> non-debug" anti-deps.
> 	(create_ddg): Adjust first_note field filling.
> 	(check_sccs): Assert if any debug instruction is in SCC.
> 	* modulo-sched.c (ps_first_note): Add an assertion if first_note
> 	is empty.
>     
> testsuite:
>     
> 20YY-MM-DD  Roman Zhuykov  <zhroma@ispras.ru>
>     
> 	* gcc.dg/pr42631-sms1.c: New test.
> 	* gcc.dg/pr42631-sms2.c: New test.
Even though we don't have a BZ, I think a bootstrap failure, even one with
modulo-scheduling enabled is severe enough that we should try to fix it.

OK for the trunk.

jeff
> 



More information about the Gcc-patches mailing list