+2020-05-12 Jozef Lawrynowicz <jozef.l@mittosystems.com>
+
+ * config/msp430/msp430-protos.h (msp430_output_aligned_decl_common):
+ Update prototype to include "local" argument.
+ * config/msp430/msp430.c (msp430_output_aligned_decl_common): Add
+ "local" argument. Handle local common decls.
+ * config/msp430/msp430.h (ASM_OUTPUT_ALIGNED_DECL_COMMON): Adjust
+ msp430_output_aligned_decl_common call with 0 for "local" argument.
+ (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Define.
+
2020-05-12 Richard Biener <rguenther@suse.de>
* cfghooks.c (split_edge): Preserve EDGE_DFS_BACK if set.
const char * msp430x_logical_shift_right (rtx);
const char * msp430_mcu_name (void);
void msp430_output_aligned_decl_common (FILE *, const tree, const char *,
- unsigned HOST_WIDE_INT, unsigned);
+ unsigned HOST_WIDE_INT, unsigned,
+ int);
void msp430_output_labelref (FILE *, const char *);
void msp430_register_pragmas (void);
rtx msp430_return_addr_rtx (int);
/* Emit a declaration of a common symbol.
If a data region is in use then put the symbol into the
- equivalent .bss section instead. */
+ equivalent .bss section instead.
+ If LOCAL is 1, then DECL is for a local common variable. */
void
msp430_output_aligned_decl_common (FILE * stream,
const tree decl,
const char * name,
unsigned HOST_WIDE_INT size,
- unsigned int align)
+ unsigned int align,
+ int local)
{
/* Only emit a common symbol if the variable does not have a specific section
assigned. */
&& !has_attr (ATTR_PERSIST, decl)
&& !has_attr (ATTR_NOINIT, decl))
{
+ if (local)
+ {
+ fprintf (stream, LOCAL_ASM_OP);
+ assemble_name (stream, name);
+ fprintf (stream, "\n");
+ }
fprintf (stream, COMMON_ASM_OP);
assemble_name (stream, name);
fprintf (stream, "," HOST_WIDE_INT_PRINT_UNSIGNED",%u\n",
switch_to_section (sec);
ASM_OUTPUT_ALIGN (stream, floor_log2 (align / BITS_PER_UNIT));
- targetm.asm_out.globalize_label (stream, name);
- ASM_WEAKEN_LABEL (stream, name);
+ if (!local)
+ {
+ targetm.asm_out.globalize_label (stream, name);
+ ASM_WEAKEN_LABEL (stream, name);
+ }
ASM_OUTPUT_LABEL (stream, name);
ASM_OUTPUT_SKIP (stream, size ? size : 1);
}
#undef USE_SELECT_SECTION_FOR_FUNCTIONS
#define USE_SELECT_SECTION_FOR_FUNCTIONS 1
+#undef ASM_OUTPUT_ALIGNED_DECL_COMMON
#define ASM_OUTPUT_ALIGNED_DECL_COMMON(FILE, DECL, NAME, SIZE, ALIGN) \
- msp430_output_aligned_decl_common ((FILE), (DECL), (NAME), (SIZE), (ALIGN))
+ msp430_output_aligned_decl_common ((FILE), (DECL), (NAME), (SIZE), (ALIGN), 0)
+
+#undef ASM_OUTPUT_ALIGNED_DECL_LOCAL
+#define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN) \
+ msp430_output_aligned_decl_common ((FILE), (DECL), (NAME), (SIZE), (ALIGN), 1)
+
#define SYMBOL_FLAG_LOW_MEM (SYMBOL_FLAG_MACH_DEP << 0)
+2020-05-12 Jozef Lawrynowicz <jozef.l@mittosystems.com>
+
+ * gcc.c-torture/execute/noinit-attribute.c: Skip for msp430
+ in the large memory model.
+
2020-05-12 Jozef Lawrynowicz <jozef.l@mittosystems.com>
* gcc.target/msp430/region-attribute-misuse.c: Allow a .bss section to
/* { dg-do run } */
/* { dg-require-effective-target noinit } */
/* { dg-options "-O2" } */
+/* { dg-skip-if "data LMA != VMA" { msp430-*-* } { "-mlarge" } } */
-/* This test checks that noinit data is handled correctly. */
+/* This test checks that noinit data is handled correctly.
+ If data LMA != VMA (e.g. for simulating the copy of data from ROM to RAM),
+ then var_init will always be re-initialized to 2 and this test will loop
+ forever. */
extern void _start (void) __attribute__ ((noreturn));
extern void abort (void) __attribute__ ((noreturn));