Commit 8682b1a5 by Jozef Lawrynowicz Committed by Jozef Lawrynowicz

MSP430: Don't generate 430X insns when handling data in the lower memory region

gcc/ChangeLog:

2019-10-07  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config.in: Regenerate.
	* config/msp430/constraints.md: Fix docstring for "Ys" constraint.
	Add new "Yx" constraint.
	* config/msp430/driver-msp430.c (msp430_propagate_region_opt): New spec
	function.
	* config/msp430/msp430-protos.h (msp430_op_not_in_high_mem): New
	prototype.
	* config/msp430/msp430.c (msp430_option_override): Allow the lower
	code/data region to be selected in the small memory model.
	(msp430_section_attr): Don't warn if the "section" and "lower"
	attributes are used together.
	(msp430_handle_generic_attribute): Likewise.
	(msp430_var_in_low_mem): New function.
	(TARGET_ENCODE_SECTION_INFO): Define.
	(msp430_encode_section_info): New function.
	(gen_prefix): Return early in the small memory model.
	Require TARGET_USE_LOWER_REGION_PREFIX to be set before adding the
	".lower" prefix if -m{code,data}-region=lower have been passed.
	(msp430_output_aligned_decl_common): Emit common symbols when
	-mdata-region=lower is passed unless TARGET_USE_LOWER_REGION_PREFIX is
	set. 
	(TARGET_ASM_FILE_END): Define.
	(msp430_file_end): New function.
	(msp430_do_not_relax_short_jumps): Allow relaxation when
	function will be in the lower region.
	(msp430_op_not_in_high_mem): New function.
	(msp430_print_operand): Check "msp430_op_not_in_high_mem" for
	the 'X' operand selector. 
	Clarify comment for 'x' operand selector.
	* config/msp430/msp430.h (LINK_SPEC): Propagate
	-m{code,data}-region to the linker via spec function
	msp430_propagate_region_opt.
	(msp430_propagate_region_opt): New prototype.
	(EXTRA_SPEC_FUNCTIONS): Add msp430_propagate_region_opt.
	(SYMBOL_FLAG_LOW_MEM): Define.
	* config/msp430/msp430.md (addsipsi3): Add missing "%X" operand
	selector.
	(zero_extendqihi2): Fix operand number used by "%X" selector.
	(zero_extendqisi2): Likewise.
	(zero_extendhisi2): Likewise.
	(movqi): Use "Yx" constraint in place of "%X" operand selector.
	(movhi): Likewise.
	(addqi3): Likewise.
	(addhi3): Likewise.
	(addsi3): Likewise.
	(addhi3_cy): Likewise.
	(addchi4_cy): Likewise.
	(subqi3): Likewise.
	(subhi3): Likewise.
	(subsi3): Likewise.
	(bic<mode>3): Likewise.
	(and<mode>3): Likewise.
	(ior<mode>3): Likewise.
	(xor<mode>3): Likewise.
	(slli_1): Add missing "%X" operand selector.
	(slll_1): Likewise.
	(slll_2): Likewise.
	(srai_1): Likewise.
	(sral_1): Likewise.
	(sral_2): Likewise.
	(srli_1): Likewise.
	(srll_1): Likewise.
	(cbranchqi4_real): Use "Yx" constraint in place of "%X" operand
	selector.
	(cbranchhi4_real): Likewise.
	(cbranchqi4_reversed): Likewise.
	(cbranchhi4_reversed): Likewise.
	(*bitbranch<mode>4): Likewise.
	(*bitbranch<mode>4_z): Remove unnecessary "%x" operand selector.
	* config/msp430/msp430.opt (mcode-region=): Set default to
	MSP430_REGION_LOWER. Improve docstring.
	(mdata-region=): Likewise.
	(muse-lower-region-prefix): New option.
	* config/msp430/t-msp430 (MULTILIB_OPTIONS): Add
	mdata-region=none multilib. 
	(MULTILIB_MATCHES): Set mdata-region={upper,either} to match
	mdata-region=none multilib. 
	MULTILIB_EXCEPTIONS: Remove.
	MULTILIB_REQUIRED: Define.
	* configure: Regenerate.
	* configure.ac: Define HAVE_AS_GNU_ATTRIBUTE and
	HAVE_AS_MSPABI_ATTRIBUTE if GAS version >= 2.33.50.
	* doc/extend.texi: Clarify comment for {upper,lower,either}
	function attributes.
	Add separate description for "lower" variable attribute.

gcc/testsuite/ChangeLog:

2019-10-07  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* gcc.target/msp430/430x-insns.c: New test.
	* gcc.target/msp430/data-attributes-2.c: Remove dg-warning
	directives for conflicts between the "section" and "lower" attributes.
	* gcc.target/msp430/msp430.exp
	(check_effective_target_msp430_region_not_lower): New.
	(check_effective_target_msp430_region_lower): New.
	* gcc.target/msp430/object-attributes-430.c: New test.
	* gcc.target/msp430/object-attributes-default.c: New test.
	* gcc.target/msp430/object-attributes-mlarge-any-region.c: New test.
	* gcc.target/msp430/object-attributes-mlarge.c: New test.

From-SVN: r276665
parent 0b06099d
2019-10-07 Jozef Lawrynowicz <jozef.l@mittosystems.com>
* config.in: Regenerate.
* config/msp430/constraints.md: Fix docstring for "Ys" constraint.
Add new "Yx" constraint.
* config/msp430/driver-msp430.c (msp430_propagate_region_opt): New spec
function.
* config/msp430/msp430-protos.h (msp430_op_not_in_high_mem): New
prototype.
* config/msp430/msp430.c (msp430_option_override): Allow the lower
code/data region to be selected in the small memory model.
(msp430_section_attr): Don't warn if the "section" and "lower"
attributes are used together.
(msp430_handle_generic_attribute): Likewise.
(msp430_var_in_low_mem): New function.
(TARGET_ENCODE_SECTION_INFO): Define.
(msp430_encode_section_info): New function.
(gen_prefix): Return early in the small memory model.
Require TARGET_USE_LOWER_REGION_PREFIX to be set before adding the
".lower" prefix if -m{code,data}-region=lower have been passed.
(msp430_output_aligned_decl_common): Emit common symbols when
-mdata-region=lower is passed unless TARGET_USE_LOWER_REGION_PREFIX is
set.
(TARGET_ASM_FILE_END): Define.
(msp430_file_end): New function.
(msp430_do_not_relax_short_jumps): Allow relaxation when
function will be in the lower region.
(msp430_op_not_in_high_mem): New function.
(msp430_print_operand): Check "msp430_op_not_in_high_mem" for
the 'X' operand selector.
Clarify comment for 'x' operand selector.
* config/msp430/msp430.h (LINK_SPEC): Propagate
-m{code,data}-region to the linker via spec function
msp430_propagate_region_opt.
(msp430_propagate_region_opt): New prototype.
(EXTRA_SPEC_FUNCTIONS): Add msp430_propagate_region_opt.
(SYMBOL_FLAG_LOW_MEM): Define.
* config/msp430/msp430.md (addsipsi3): Add missing "%X" operand
selector.
(zero_extendqihi2): Fix operand number used by "%X" selector.
(zero_extendqisi2): Likewise.
(zero_extendhisi2): Likewise.
(movqi): Use "Yx" constraint in place of "%X" operand selector.
(movhi): Likewise.
(addqi3): Likewise.
(addhi3): Likewise.
(addsi3): Likewise.
(addhi3_cy): Likewise.
(addchi4_cy): Likewise.
(subqi3): Likewise.
(subhi3): Likewise.
(subsi3): Likewise.
(bic<mode>3): Likewise.
(and<mode>3): Likewise.
(ior<mode>3): Likewise.
(xor<mode>3): Likewise.
(slli_1): Add missing "%X" operand selector.
(slll_1): Likewise.
(slll_2): Likewise.
(srai_1): Likewise.
(sral_1): Likewise.
(sral_2): Likewise.
(srli_1): Likewise.
(srll_1): Likewise.
(cbranchqi4_real): Use "Yx" constraint in place of "%X" operand
selector.
(cbranchhi4_real): Likewise.
(cbranchqi4_reversed): Likewise.
(cbranchhi4_reversed): Likewise.
(*bitbranch<mode>4): Likewise.
(*bitbranch<mode>4_z): Remove unnecessary "%x" operand selector.
* config/msp430/msp430.opt (mcode-region=): Set default to
MSP430_REGION_LOWER. Improve docstring.
(mdata-region=): Likewise.
(muse-lower-region-prefix): New option.
* config/msp430/t-msp430 (MULTILIB_OPTIONS): Add
mdata-region=none multilib.
(MULTILIB_MATCHES): Set mdata-region={upper,either} to match
mdata-region=none multilib.
MULTILIB_EXCEPTIONS: Remove.
MULTILIB_REQUIRED: Define.
* configure: Regenerate.
* configure.ac: Define HAVE_AS_GNU_ATTRIBUTE and
HAVE_AS_MSPABI_ATTRIBUTE if GAS version >= 2.33.50.
* doc/extend.texi: Clarify comment for {upper,lower,either}
function attributes.
Add separate description for "lower" variable attribute.
2019-10-07 Ilya Leoshkevich <iii@linux.ibm.com>
PR target/77918
......
......@@ -553,6 +553,12 @@
#endif
/* Define if your assembler supports .mspabi_attribute. */
#ifndef USED_FOR_TARGET
#undef HAVE_AS_MSPABI_ATTRIBUTE
#endif
/* Define if the assembler understands -mnan=. */
#ifndef USED_FOR_TARGET
#undef HAVE_AS_NAN
......
......@@ -69,9 +69,11 @@
;; These are memory references that are safe to use without the X suffix,
;; because we know/assume they need not index across the 64k boundary.
;; because we know/assume they need not index across the 64K boundary.
;; Note that for a PSImode memory operand, we always need to use the X suffix,
;; regardless of what this constraint decides.
(define_constraint "Ys"
"Memory reference, stack only."
"Memory reference, indexed or indirect register addressing modes."
(and (match_code "mem")
(ior
(and (match_code "plus" "0")
......@@ -93,3 +95,7 @@
(match_test ("REGNO (XEXP (XEXP (op, 0), 0)) != SP_REGNO")))
))))
(define_constraint "Yx"
"Memory reference, in lower memory below address 0x10000."
(and (match_code "mem")
(match_test "msp430_op_not_in_high_mem (op)")))
......@@ -149,3 +149,16 @@ msp430_select_hwmult_lib (int argc ATTRIBUTE_UNUSED,
return "-lmul_none";
}
/* Spec function. Propagate -m{code,data}-region= to the linker, unless the
lower region has been specified without -muse-lower-region-prefix also being
used. */
const char *
msp430_propagate_region_opt (int argc, const char **argv)
{
if (strcmp (argv[0], "lower") != 0)
return argv[0];
else if ((argc == 2) && (strcmp (argv[1], "-muse-lower-region-prefix") == 0))
return argv[0]; /* argv[0] == "lower". */
return "none";
}
......@@ -47,5 +47,6 @@ void msp430_split_movsi (rtx *);
void msp430_start_function (FILE *, const char *, tree);
rtx msp430_subreg (machine_mode, rtx, machine_mode, int);
bool msp430_use_f5_series_hwmult (void);
bool msp430_op_not_in_high_mem (rtx op);
#endif /* GCC_MSP430_PROTOS_H */
......@@ -71,7 +71,10 @@ extern bool msp430x;
is enabled (the GDB testsuite relies upon unused entities not being
deleted). */
#define LINK_SPEC "%{mrelax:--relax} %{mlarge:%{!r:%{!g:--gc-sections}}} " \
"%{mcode-region=*:--code-region=%*} %{mdata-region=*:--data-region=%*}"
"%{mcode-region=*:--code-region=%:" \
"msp430_propagate_region_opt(%* %{muse-lower-region-prefix})} " \
"%{mdata-region=*:--data-region=%:" \
"msp430_propagate_region_opt(%* %{muse-lower-region-prefix})} " \
#define DRIVER_SELF_SPECS \
" %{!mlarge:%{mcode-region=*:%{mdata-region=*:%e-mcode-region and " \
......@@ -90,12 +93,16 @@ extern const char * msp430_select_hwmult_lib (int, const char **);
extern const char * msp430_select_cpu (int, const char **);
extern const char * msp430_set_driver_var (int, const char **);
extern const char * msp430_check_path_for_devices (int, const char **);
extern const char *msp430_propagate_region_opt (int, const char **);
/* There must be a trailing comma after the last item, see gcc.c
"static_spec_functions". */
# define EXTRA_SPEC_FUNCTIONS \
{ "msp430_hwmult_lib", msp430_select_hwmult_lib }, \
{ "msp430_select_cpu", msp430_select_cpu }, \
{ "msp430_set_driver_var", msp430_set_driver_var }, \
{ "msp430_check_path_for_devices", msp430_check_path_for_devices },
{ "msp430_check_path_for_devices", msp430_check_path_for_devices }, \
{ "msp430_propagate_region_opt", msp430_propagate_region_opt },
/* Specify the libraries to include on the linker command line.
......@@ -482,3 +489,5 @@ typedef struct
#define ASM_OUTPUT_ALIGNED_DECL_COMMON(FILE, DECL, NAME, SIZE, ALIGN) \
msp430_output_aligned_decl_common ((FILE), (DECL), (NAME), (SIZE), (ALIGN))
#define SYMBOL_FLAG_LOW_MEM (SYMBOL_FLAG_MACH_DEP << 0)
......@@ -67,12 +67,16 @@ EnumValue
Enum(msp430_hwmult_types) String(f5series) Value(MSP430_HWMULT_F5SERIES)
mcode-region=
Target Joined RejectNegative Report ToLower Var(msp430_code_region) Enum(msp430_regions) Init(MSP430_REGION_ANY)
Specify whether functions should be placed into low or high memory.
Target Joined RejectNegative Report ToLower Var(msp430_code_region) Enum(msp430_regions) Init(MSP430_REGION_LOWER)
Specify whether functions should be placed into the lower or upper memory regions, or if they should be shuffled between the regions (either) for best fit (default: lower).
mdata-region=
Target Joined RejectNegative Report ToLower Var(msp430_data_region) Enum(msp430_regions) Init(MSP430_REGION_ANY)
Specify whether variables should be placed into low or high memory.
Target Joined RejectNegative Report ToLower Var(msp430_data_region) Enum(msp430_regions) Init(MSP430_REGION_LOWER)
Specify whether variables should be placed into the lower or upper memory regions, or if they should be shuffled between the regions (either) for best fit (default: lower).
muse-lower-region-prefix
Target Mask(USE_LOWER_REGION_PREFIX) Report
Add the .lower prefix to section names when compiling with -m{code,data}-region=lower (disabled by default).
Enum
Name(msp430_regions) Type(enum msp430_regions)
......
......@@ -28,17 +28,22 @@ msp430-devices.o: $(srcdir)/config/msp430/msp430-devices.c \
# Enable multilibs:
MULTILIB_OPTIONS = mcpu=msp430 mlarge
MULTILIB_DIRNAMES = 430 large
MULTILIB_OPTIONS = mcpu=msp430 mlarge mdata-region=none
MULTILIB_DIRNAMES = 430 large full-memory-range
# Match -mcpu=430
MULTILIB_MATCHES = mcpu?msp430=mcpu?430
# These options are equivalent in terms of the multilib required for them
MULTILIB_MATCHES += mdata-region?none=mdata-region?upper
MULTILIB_MATCHES += mdata-region?none=mdata-region?either
# The correct multilib for a given mmcu is selected without the need for
# hard-coded data here, because DRIVER_SELF_SPECS will place the correct
# -mcpu option for a given mcu onto the command line.
MULTILIB_EXCEPTIONS = mcpu=msp430/mlarge
MULTILIB_REQUIRED = mcpu=msp430
MULTILIB_REQUIRED += mlarge
MULTILIB_REQUIRED += mlarge/mdata-region=none
MULTILIB_EXTRA_OPTS =
......
......@@ -27773,6 +27773,80 @@ fi
as_fn_error $? "Requesting --with-nan= requires assembler support for -mnan=" "$LINENO" 5
fi
;;
msp430-*-*)
# Earlier GAS versions generically support .gnu_attribute, but the
# msp430 assembler will not do anything with it.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .gnu_attribute support" >&5
$as_echo_n "checking assembler for .gnu_attribute support... " >&6; }
if ${gcc_cv_as_msp430_gnu_attribute+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_msp430_gnu_attribute=no
if test $in_tree_gas = yes; then
if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 33 \) \* 1000 + 50`
then gcc_cv_as_msp430_gnu_attribute=yes
fi
elif test x$gcc_cv_as != x; then
$as_echo '.gnu_attribute 4,1' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
(eval $ac_try) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }
then
gcc_cv_as_msp430_gnu_attribute=yes
else
echo "configure: failed program was" >&5
cat conftest.s >&5
fi
rm -f conftest.o conftest.s
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_msp430_gnu_attribute" >&5
$as_echo "$gcc_cv_as_msp430_gnu_attribute" >&6; }
if test $gcc_cv_as_msp430_gnu_attribute = yes; then
$as_echo "#define HAVE_AS_GNU_ATTRIBUTE 1" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .mspabi_attribute support" >&5
$as_echo_n "checking assembler for .mspabi_attribute support... " >&6; }
if ${gcc_cv_as_msp430_mspabi_attribute+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_msp430_mspabi_attribute=no
if test $in_tree_gas = yes; then
if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 33 \) \* 1000 + 50`
then gcc_cv_as_msp430_mspabi_attribute=yes
fi
elif test x$gcc_cv_as != x; then
$as_echo '.mspabi_attribute 4,1' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
(eval $ac_try) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }
then
gcc_cv_as_msp430_mspabi_attribute=yes
else
echo "configure: failed program was" >&5
cat conftest.s >&5
fi
rm -f conftest.o conftest.s
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_msp430_mspabi_attribute" >&5
$as_echo "$gcc_cv_as_msp430_mspabi_attribute" >&6; }
if test $gcc_cv_as_msp430_mspabi_attribute = yes; then
$as_echo "#define HAVE_AS_MSPABI_ATTRIBUTE 1" >>confdefs.h
fi
;;
riscv*-*-*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .attribute support" >&5
$as_echo_n "checking assembler for .attribute support... " >&6; }
......
......@@ -4949,6 +4949,20 @@ pointers into PC-relative form.])
[Requesting --with-nan= requires assembler support for -mnan=])
fi
;;
msp430-*-*)
# Earlier GAS versions generically support .gnu_attribute, but the
# msp430 assembler will not do anything with it.
gcc_GAS_CHECK_FEATURE([.gnu_attribute support],
gcc_cv_as_msp430_gnu_attribute, [2,33,50],,
[.gnu_attribute 4,1],,
[AC_DEFINE(HAVE_AS_GNU_ATTRIBUTE, 1,
[Define if your assembler supports .gnu_attribute.])])
gcc_GAS_CHECK_FEATURE([.mspabi_attribute support],
gcc_cv_as_msp430_mspabi_attribute, [2,33,50],,
[.mspabi_attribute 4,1],,
[AC_DEFINE(HAVE_AS_MSPABI_ATTRIBUTE, 1,
[Define if your assembler supports .mspabi_attribute.])])
;;
riscv*-*-*)
gcc_GAS_CHECK_FEATURE([.attribute support],
gcc_cv_as_riscv_attribute, [2,32,0],,
......
......@@ -5206,7 +5206,7 @@ On the MSP430 target these attributes can be used to specify whether
the function or variable should be placed into low memory, high
memory, or the placement should be left to the linker to decide. The
attributes are only significant if compiling for the MSP430X
architecture.
architecture in the large memory model.
The attributes work in conjunction with a linker script that has been
augmented to specify where to place sections with a @code{.lower} and
......@@ -7537,15 +7537,30 @@ value will be retained across resets. The linker script being used to
create the application should ensure that persistent data is correctly
placed.
@item lower
@itemx upper
@item upper
@itemx either
@cindex @code{lower} variable attribute, MSP430
@cindex @code{upper} variable attribute, MSP430
@cindex @code{either} variable attribute, MSP430
These attributes are the same as the MSP430 function attributes of the
same name (@pxref{MSP430 Function Attributes}).
These attributes can be applied to both functions and variables.
@item lower
@cindex @code{lower} variable attribute, MSP430
This option behaves mostly the same as the MSP430 function attribute of the
same name (@pxref{MSP430 Function Attributes}), but it has some additional
functionality.
If @option{-mdata-region=}@{@code{upper,either,none}@} has been passed, or
the @code{section} attribute is applied to a variable, the compiler will
generate 430X instructions to handle it. This is because the compiler has
to assume that the variable could get placed in the upper memory region
(above address 0xFFFF). Marking the variable with the @code{lower} attribute
informs the compiler that the variable will be placed in lower memory so it
is safe to use 430 instructions to handle it.
In the case of the @code{section} attribute, the section name given
will be used, and the @code{.lower} prefix will not be added.
@end table
@node Nvidia PTX Variable Attributes
......
2019-10-07 Jozef Lawrynowicz <jozef.l@mittosystems.com>
* gcc.target/msp430/430x-insns.c: New test.
* gcc.target/msp430/data-attributes-2.c: Remove dg-warning
directives for conflicts between the "section" and "lower" attributes.
* gcc.target/msp430/msp430.exp
(check_effective_target_msp430_region_not_lower): New.
(check_effective_target_msp430_region_lower): New.
* gcc.target/msp430/object-attributes-430.c: New test.
* gcc.target/msp430/object-attributes-default.c: New test.
* gcc.target/msp430/object-attributes-mlarge-any-region.c: New test.
* gcc.target/msp430/object-attributes-mlarge.c: New test.
2019-10-07 Jakub Jelinek <jakub@redhat.com>
* gcc.target/i386/pr71801.c (uuidcache_init): Fix up size of d array.
......
......@@ -27,7 +27,7 @@ int __attribute__((lower,upper)) lu = 20; /* { dg-warning "ignoring attribute 'u
int __attribute__((lower,either)) le = 20; /* { dg-warning "ignoring attribute 'either' because it conflicts with attribute 'lower'" } */
int __attribute__((lower,persistent)) lp = 20; /* { dg-warning "ignoring attribute 'persistent' because it conflicts with attribute 'lower'" } */
int __attribute__((lower,noinit)) ln; /* { dg-warning "ignoring attribute 'noinit' because it conflicts with attribute 'lower'" } */
int __attribute__((lower,section(".data.foo"))) ls = 30; /* { dg-warning "ignoring attribute 'section' because it conflicts with attribute 'lower'" } */
int __attribute__((lower,section(".data.foo"))) ls = 30;
int __attribute__((upper)) u = 20;
int __attribute__((upper,lower)) ul = 20; /* { dg-warning "ignoring attribute 'lower' because it conflicts with attribute 'upper'" } */
......@@ -46,6 +46,6 @@ int __attribute__((either,section(".data.foo"))) es = 30; /* { dg-warning "ignor
int __attribute__((section(".data.foo"))) s = 20;
int __attribute__((section(".data.foo"),noinit)) sn; /* { dg-warning "ignoring attribute 'noinit' because it conflicts with attribute 'section'" } */
int __attribute__((section(".data.foo"),persistent)) sp = 20; /* { dg-warning "ignoring attribute 'persistent' because it conflicts with attribute 'section'" } */
int __attribute__((section(".data.foo"),lower)) sl = 2; /* { dg-warning "ignoring attribute 'lower' because it conflicts with attribute 'section'" } */
int __attribute__((section(".data.foo"),lower)) sl = 2;
int __attribute__((section(".data.foo"),upper)) su = 20; /* { dg-warning "ignoring attribute 'upper' because it conflicts with attribute 'section'" } */
int __attribute__((section(".data.foo"),either)) se = 2; /* { dg-warning "ignoring attribute 'either' because it conflicts with attribute 'section'" } */
......@@ -36,6 +36,14 @@ proc check_effective_target_msp430_mlarge_selected { } {
return [check-flags [list "" { *-*-* } { "-mlarge" } { "" } ]]
}
proc check_effective_target_msp430_region_not_lower { } {
return [check-flags [list "" { *-*-* } { "-mdata-region=none" "-mdata-region=upper" "-mdata-region=either" } { "" } ]]
}
proc check_effective_target_msp430_region_lower { } {
return [check-flags [list "" { *-*-* } { "*" } { "-mdata-region=none" "-mdata-region=upper" "-mdata-region=either" } ]]
}
proc check_effective_target_msp430_hwmul_not_none { } {
return [check-flags [list "" { *-*-* } \
{ "-mhwmult=16bit" "-mhwmult=32bit" "-mhwmult=f5series" } { "" } ]]
......
/* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "-mcpu=msp430x" "-mlarge" } { "" } } */
/* { dg-options "-mcpu=msp430" } */
/* { dg-final { scan-assembler ".mspabi_attribute 4, 1" } } */
/* { dg-final { scan-assembler ".mspabi_attribute 6, 1" } } */
/* { dg-final { scan-assembler ".mspabi_attribute 8, 1" } } */
/* { dg-final { scan-assembler ".gnu_attribute 4, 1" } } */
int
main (void)
{
while (1);
return 0;
}
/* { dg-do compile } */
/* { dg-final { scan-assembler ".mspabi_attribute 4, 1" { target msp430_430_selected } } } */
/* { dg-final { scan-assembler ".mspabi_attribute 4, 2" { target msp430_430x_selected } } } */
/* { dg-final { scan-assembler ".mspabi_attribute 6, 1" { target { ! msp430_mlarge_selected } } } } */
/* { dg-final { scan-assembler ".mspabi_attribute 8, 1" { target { ! msp430_mlarge_selected } } } } */
/* { dg-final { scan-assembler ".mspabi_attribute 6, 2" { target msp430_mlarge_selected } } } */
/* { dg-final { scan-assembler ".mspabi_attribute 8, 2" { target msp430_mlarge_selected } } } */
/* { dg-final { scan-assembler ".gnu_attribute 4, 1" { target { ! msp430_region_not_lower } } } } */
/* { dg-final { scan-assembler ".gnu_attribute 4, 2" { target msp430_region_not_lower } } } */
int
main (void)
{
while (1);
return 0;
}
/* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "-mcpu=msp430" "-mdata-region=lower" } { "" } } */
/* { dg-options "-mlarge -mdata-region=none" } */
/* { dg-final { scan-assembler ".mspabi_attribute 4, 2" } } */
/* { dg-final { scan-assembler ".mspabi_attribute 6, 2" } } */
/* { dg-final { scan-assembler ".mspabi_attribute 8, 2" } } */
/* { dg-final { scan-assembler ".gnu_attribute 4, 2" } } */
int
main (void)
{
while (1);
return 0;
}
/* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "-mcpu=msp430" } { "" } } */
/* { dg-options "-mlarge" } */
/* { dg-final { scan-assembler ".mspabi_attribute 4, 2" } } */
/* { dg-final { scan-assembler ".mspabi_attribute 6, 2" } } */
/* { dg-final { scan-assembler ".mspabi_attribute 8, 2" } } */
/* { dg-final { scan-assembler ".gnu_attribute 4, 1" { target msp430_region_lower } } } */
/* { dg-final { scan-assembler ".gnu_attribute 4, 2" { target { ! msp430_region_lower } } } } */
int
main (void)
{
while (1);
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment