diff mbox series

[riscv] Wrap ASM_OUTPUT_LABELREF in do {} while (0)

Message ID bdf2ee36-8223-e927-9d3d-25beb3dadfb0@mentor.com
State New
Headers show
Series [riscv] Wrap ASM_OUTPUT_LABELREF in do {} while (0) | expand

Commit Message

Tom de Vries Nov. 12, 2017, 4:44 p.m. UTC
Hi,

this patch wraps riscv.h's ASM_OUTPUT_LABELREF in "do {} while (0)".

Build for riscv64.

Committed as obvious.

Thanks,
- Tom

Comments

Andrew Waterman Nov. 12, 2017, 11:02 p.m. UTC | #1
Thanks, Tom.

On Sun, Nov 12, 2017 at 8:44 AM, Tom de Vries <Tom_deVries@mentor.com>
wrote:

> Hi,
>
> this patch wraps riscv.h's ASM_OUTPUT_LABELREF in "do {} while (0)".
>
> Build for riscv64.
>
> Committed as obvious.
>
> Thanks,
> - Tom
>
diff mbox series

Patch

[riscv] Wrap ASM_OUTPUT_LABELREF in do {} while (0)

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

	* config/riscv/riscv.h (ASM_OUTPUT_LABELREF): Wrap in do {} while (0).

---
 gcc/config/riscv/riscv.h | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/gcc/config/riscv/riscv.h b/gcc/config/riscv/riscv.h
index 91a9c33..fe09e84 100644
--- a/gcc/config/riscv/riscv.h
+++ b/gcc/config/riscv/riscv.h
@@ -585,12 +585,15 @@  typedef struct {
 /* This handles the magic '..CURRENT_FUNCTION' symbol, which means
    'the start of the function that this code is output in'.  */
 
-#define ASM_OUTPUT_LABELREF(FILE,NAME)  \
-  if (strcmp (NAME, "..CURRENT_FUNCTION") == 0)				\
-    asm_fprintf ((FILE), "%U%s",					\
-		 XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));	\
-  else									\
-    asm_fprintf ((FILE), "%U%s", (NAME))
+#define ASM_OUTPUT_LABELREF(FILE,NAME)					\
+  do {									\
+    if (strcmp (NAME, "..CURRENT_FUNCTION") == 0)			\
+      asm_fprintf ((FILE), "%U%s",					\
+		   XSTR (XEXP (DECL_RTL (current_function_decl),	\
+			       0), 0));					\
+    else								\
+      asm_fprintf ((FILE), "%U%s", (NAME));				\
+  } while (0)
 
 #define JUMP_TABLES_IN_TEXT_SECTION 0
 #define CASE_VECTOR_MODE SImode