[COMMITTED] gas: ginsn: x86: pacify Wmaybe-uininitialized compiler warning

Message ID 20240819182056.1532848-1-indu.bhagat@oracle.com
State New
Headers
Series [COMMITTED] gas: ginsn: x86: pacify Wmaybe-uininitialized compiler warning |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm warning Patch is already merged
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 warning Patch is already merged

Commit Message

Indu Bhagat Aug. 19, 2024, 6:20 p.m. UTC
  Fix PR binutils/32091

After commit d56083b5047b8e7cc9eda2f867bd2b75724920a1, some gcc versions
may warn about unintialized usage of ginsn_func.  Albeit false positive,
adapt the code to escape the warning.

gas/config/
	* tc-i386-ginsn.c (x86_ginsn_indirect_branch): Early exit if
	unexpected args.
---
Committed as obvious.

 gas/config/tc-i386-ginsn.c | 2 ++
 1 file changed, 2 insertions(+)
  

Patch

diff --git a/gas/config/tc-i386-ginsn.c b/gas/config/tc-i386-ginsn.c
index b9dc9c10cbb..a4ebdf14fe4 100644
--- a/gas/config/tc-i386-ginsn.c
+++ b/gas/config/tc-i386-ginsn.c
@@ -488,6 +488,8 @@  x86_ginsn_indirect_branch (const symbolS *insn_end_sym)
   else if (i.tm.extension_opcode == 2)
     /* 0xFF /2 (call r/m).  */
     ginsn_func = ginsn_new_call;
+  else
+    return ginsn;
 
   if (i.reg_operands)
     {