+2019-02-10 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR gas/24165
+ * config/tc-i386.h (MAX_MEM_FOR_RS_ALIGN_CODE): Set to
+ (alignment ? ((1 << alignment) - 1) : 1)
+ (i386_tc_frag_data): Add max_bytes.
+ (TC_FRAG_INIT): Track max_chars in max_bytes.
+ (HANDLE_ALIGN): Replace MAX_MEM_FOR_RS_ALIGN_CODE with
+ fragP->tc_frag_data.max_bytes.
+
2019-02-07 Eric Botcazou <ebotcazou@adacore.com>
* config/tc-visium.c (md_assemble) <mode_cad>: Align instruction on
goto around; \
}
-#define MAX_MEM_FOR_RS_ALIGN_CODE 4095
+#define MAX_MEM_FOR_RS_ALIGN_CODE (alignment ? ((1 << alignment) - 1) : 1)
void i386_print_statistics (FILE *);
#define tc_print_statistics i386_print_statistics
enum processor_type isa;
i386_cpu_flags isa_flags;
enum processor_type tune;
+ unsigned int max_bytes;
};
/* We need to emit the right NOP pattern in .align frags. This is
the isa/tune settings at the time the .align was assembled. */
#define TC_FRAG_TYPE struct i386_tc_frag_data
+/* NB: max_chars is a local variable in frag_var_init. */
#define TC_FRAG_INIT(FRAGP) \
do \
{ \
(FRAGP)->tc_frag_data.isa = cpu_arch_isa; \
(FRAGP)->tc_frag_data.isa_flags = cpu_arch_isa_flags; \
(FRAGP)->tc_frag_data.tune = cpu_arch_tune; \
+ (FRAGP)->tc_frag_data.max_bytes = max_chars; \
} \
while (0)
offsetT __count = (fragP->fr_next->fr_address \
- fragP->fr_address \
- fragP->fr_fix); \
- if (__count > 0 && __count <= MAX_MEM_FOR_RS_ALIGN_CODE) \
+ if (__count > 0 \
+ && (unsigned int) __count <= fragP->tc_frag_data.max_bytes) \
md_generate_nops (fragP, fragP->fr_literal + fragP->fr_fix, \
__count, 0); \
}