rtl-optimization: Fix data flow maintenance bug in reg-stack.c [pr97777]

reg-stack pass does not maintain the data flow information correctly.
call df_insn_rescan_all after the transformation is done.

        gcc/
	PR rtl-optimization/97777
	* reg-stack.c (rest_of_handle_stack_regs): call
	df_insn_rescan_all if reg_to_stack return true.

	gcc/testsuite/
	PR rtl-optimization/97777
	* gcc.target/i386/pr97777.c: New test.
This commit is contained in:
qing zhao 2020-12-02 23:48:02 +01:00
parent dc2b372ed1
commit 2cace1cd68
2 changed files with 11 additions and 1 deletions

View File

@ -3426,7 +3426,8 @@ static unsigned int
rest_of_handle_stack_regs (void)
{
#ifdef STACK_REGS
reg_to_stack ();
if (reg_to_stack ())
df_insn_rescan_all ();
regstack_completed = 1;
#endif
return 0;

View File

@ -0,0 +1,9 @@
/* { dg-do compile { target *-*-linux* } } */
/* { dg-options "-O -fzero-call-used-regs=used -ffinite-math-only" } */
float
foo (void)
{
return __builtin_fmod (0, 0);
}