diff mbox series

[sh,committed] Wrap ASM_OUTPUT_ADDR_VEC_ELT in do {} while (0)

Message ID 4b4ad5b6-a0d7-0ca9-7277-f998b6c07be3@mentor.com
State New
Headers show
Series [sh,committed] Wrap ASM_OUTPUT_ADDR_VEC_ELT in do {} while (0) | expand

Commit Message

Tom de Vries Nov. 23, 2017, 8 p.m. UTC
Hi,

this patch wraps the sh version of ASM_OUTPUT_ADDR_VEC_ELT in "do {} 
while (0)".  This allows the macro to be used in if-then-elses without 
curly braces.

Build for sh.

Committed as obvious.

Thanks,
- Tom
diff mbox series

Patch

[sh] Wrap ASM_OUTPUT_ADDR_VEC_ELT in do {} while (0)

2017-11-23  Tom de Vries  <tom@codesourcery.com>

	* config/sh/sh.h (ASM_OUTPUT_ADDR_VEC_ELT): Wrap in "do {} while (0)".

---
 gcc/config/sh/sh.h | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index f5d80da..82699cd 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -1754,12 +1754,13 @@  extern bool current_function_interrupt;
     }
 
 /* Output an absolute table element.  */
-#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM,VALUE)  				\
-  if (! optimize || TARGET_BIGTABLE)					\
-    asm_fprintf ((STREAM), "\t.long\t%LL%d\n", (VALUE)); 		\
-  else									\
-    asm_fprintf ((STREAM), "\t.word\t%LL%d\n", (VALUE));
-
+#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM,VALUE) \
+  do {									\
+    if (! optimize || TARGET_BIGTABLE)					\
+      asm_fprintf ((STREAM), "\t.long\t%LL%d\n", (VALUE)); 		\
+    else								\
+      asm_fprintf ((STREAM), "\t.word\t%LL%d\n", (VALUE));		\
+  } while (0)
 
 /* A C statement to be executed just prior to the output of
    assembler code for INSN, to modify the extracted operands so