Fix RTL FE issue with premature return

Message ID 607o2so7-3482-122r-n2q1-s1r9n791s724@fhfr.qr
State Committed
Commit e2194a8b39251497d770abf3fb6ee06de6072ed9
Headers
Series Fix RTL FE issue with premature return |

Commit Message

Richard Biener Nov. 29, 2021, 11:26 a.m. UTC
  This fixes an issue discovered by -Wunreachable-code-return

Bootstrap / regtest pending on x86_64-unknown-linux-gnu, OK?

2021-11-29  Richard Biener  <rguenther@suse.de>

	* read-rtl-function.c (function_reader::read_rtx_operand):
	Return only after resetting m_in_call_function_usage.
---
 gcc/read-rtl-function.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Jeff Law Nov. 29, 2021, 2:29 p.m. UTC | #1
On 11/29/2021 4:26 AM, Richard Biener via Gcc-patches wrote:
> This fixes an issue discovered by -Wunreachable-code-return
>
> Bootstrap / regtest pending on x86_64-unknown-linux-gnu, OK?
>
> 2021-11-29  Richard Biener  <rguenther@suse.de>
>
> 	* read-rtl-function.c (function_reader::read_rtx_operand):
> 	Return only after resetting m_in_call_function_usage.
OK.
jeff
  

Patch

diff --git a/gcc/read-rtl-function.c b/gcc/read-rtl-function.c
index 5699f574a37..81d7531ce47 100644
--- a/gcc/read-rtl-function.c
+++ b/gcc/read-rtl-function.c
@@ -886,8 +886,9 @@  function_reader::read_rtx_operand (rtx x, int idx)
       if (idx == 7 && CALL_P (x))
 	{
 	  m_in_call_function_usage = true;
-	  return rtx_reader::read_rtx_operand (x, idx);
+	  rtx tem = rtx_reader::read_rtx_operand (x, idx);
 	  m_in_call_function_usage = false;
+	  return tem;
 	}
       else
 	return rtx_reader::read_rtx_operand (x, idx);