From: qing zhao Date: Wed, 2 Dec 2020 22:48:02 +0000 (+0100) Subject: rtl-optimization: Fix data flow maintenance bug in reg-stack.c [pr97777] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2cace1cd683318e83e8a613f1aa2f2b16e37a342;p=gcc.git 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. --- diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c index 8f98bd85750..3dab843f803 100644 --- a/gcc/reg-stack.c +++ b/gcc/reg-stack.c @@ -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; diff --git a/gcc/testsuite/gcc.target/i386/pr97777.c b/gcc/testsuite/gcc.target/i386/pr97777.c new file mode 100644 index 00000000000..fcefc098637 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr97777.c @@ -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); +} +