loongarch gcc-4.9 build error

Message ID all0LujI3LN4ksdO@squeak.grove.modra.org
State New
Headers
Series loongarch gcc-4.9 build error |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 fail Patch failed to apply

Commit Message

Alan Modra July 17, 2026, 12:15 a.m. UTC
  gas/config/tc-loongarch.c: In function ‘md_apply_fix’:
gas/config/tc-loongarch.c:1886:7: error: a label can only be part of a statement and a declaration is not a statement
       unsigned int subtype;
       ^

	* config/tc-loongarch.c (md_apply_fix <BFD_RELOC_LARCH_CFA>):
	Avoid gcc-4.9 error.
  

Patch

diff -w shown, actual patch indents the block.

diff --git a/gas/config/tc-loongarch.c b/gas/config/tc-loongarch.c
index e67394c460c..bd7d8dabb7a 100644
--- a/gas/config/tc-loongarch.c
+++ b/gas/config/tc-loongarch.c
@@ -1883,6 +1883,7 @@  md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
       break;
 
     case BFD_RELOC_LARCH_CFA:
+      {
 	unsigned int subtype;
 	fragS *opfrag = (fragS *) fixP->fx_frag->fr_opcode;
 	subtype = bfd_get_8 (NULL, opfrag->fr_literal + fixP->fx_where);
@@ -1947,6 +1948,7 @@  md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
 
 	if (fixP->fx_addsy == NULL)
 	  fixP->fx_done = 1;
+      }
       break;
 
     case BFD_RELOC_LARCH_B16: