Skip to content

Commit 211a7f4

Browse files
clazissartemiy-volkov
authored andcommitted
[ARCx] Fix emitting labels and aligns
1 parent 2143233 commit 211a7f4

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

gcc/config/arc64/arc64.h

+13-7
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ extern const enum reg_class arc64_regno_to_regclass[];
434434
#define ASM_COMMENT_START "#"
435435

436436
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
437-
fprintf(FILE, "\t.align\t%d\n", (int)LOG)
437+
fprintf(FILE, "\t.align\t%d\n", 1 << (int)LOG)
438438

439439
/* Output to assembler file text saying following lines
440440
may contain character constants, extra white space, comments, etc. */
@@ -446,12 +446,18 @@ extern const enum reg_class arc64_regno_to_regclass[];
446446
#undef ASM_APP_OFF
447447
#define ASM_APP_OFF ""
448448

449-
#undef ASM_OUTPUT_LABELREF
450-
#define ASM_OUTPUT_LABELREF(FILE,NAME) \
451-
do { \
452-
fputs ("@", (FILE)); \
453-
fputs ((NAME), (FILE)); \
454-
} while (0)
449+
/* This is how to output a reference to a symbol_ref / label_ref as
450+
(part of) an operand. To disambiguate from register names like a1
451+
/ a2 / status etc, symbols are preceded by '@'. */
452+
#define ASM_OUTPUT_SYMBOL_REF(FILE,SYM) \
453+
ASM_OUTPUT_LABEL_REF ((FILE), XSTR ((SYM), 0))
454+
#define ASM_OUTPUT_LABEL_REF(FILE,STR) \
455+
do \
456+
{ \
457+
fputs ("@", (FILE)); \
458+
assemble_name ((FILE), (STR)); \
459+
} \
460+
while (0)
455461

456462
/* Section selection. */
457463

0 commit comments

Comments
 (0)