Commit ae578943 by Nathan Sidwell Committed by Nathan Sidwell

nptx.c (nvptx_option_override): Only set flag_toplevel_reorder, if not explicitly specified.

	* config/nvptx/nptx.c (nvptx_option_override): Only set
	flag_toplevel_reorder, if not explicitly specified.  Set
	flag_no_common, unless explicitly specified.

	testsuite/
	* gcc.target/nvptx/uninit-decl.c: Force common storage,  add
	non-common cases.
	* gcc.dg/tree-ssa/ssa-store-ccp-2.c: Add -fcommon.

From-SVN: r236532
parent 15c671a7
2016-05-20 Nathan Sidwell <nathan@acm.org>
* config/nvptx/nptx.c (nvptx_option_override): Only set
flag_toplevel_reorder, if not explicitly specified. Set
flag_no_common, unless explicitly specified.
2016-05-20 David Malcolm <dmalcolm@redhat.com>
* calls.c (can_implement_as_sibling_call_p): Mark param
......
......@@ -155,8 +155,19 @@ static void
nvptx_option_override (void)
{
init_machine_status = nvptx_init_machine_status;
/* Gives us a predictable order, which we need especially for variables. */
flag_toplevel_reorder = 1;
/* Set toplevel_reorder, unless explicitly disabled. We need
reordering so that we emit necessary assembler decls of
undeclared variables. */
if (!global_options_set.x_flag_toplevel_reorder)
flag_toplevel_reorder = 1;
/* Set flag_no_common, unless explicitly disabled. We fake common
using .weak, and that's not entirely accurate, so avoid it
unless forced. */
if (!global_options_set.x_flag_no_common)
flag_no_common = 1;
/* Assumes that it will see only hard registers. */
flag_var_tracking = 0;
......
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
/* { dg-options "-O2 -fdump-tree-optimized -fcommon" } */
const int conststaticvariable;
......
/* { dg-do compile } */
int __attribute__ ((used)) common;
static int __attribute__ ((used)) local;
int __attribute__ ((common)) common;
static int local;
extern int external_decl;
int external_defn;
int foo ()
{
return common + local + external_decl + external_defn;
}
void bar (int i)
{
common = local = external_decl = external_defn = i;
}
/* { dg-final { scan-assembler "\[\n\r\]\[\t \]*.weak .global\[^,\n\r\]*common" } } */
/* { dg-final { scan-assembler "\[\n\r\]\[\t \]*.global\[^,\n\r\]*local" } } */
/* { dg-final { scan-assembler "\[\n\r\]\[\t \]*.extern .global\[^,\n\r\]*external_decl" } } */
/* { dg-final { scan-assembler "\[\n\r\]\[\t \]*.visible .global\[^,\n\r\]*external_defn" } } */
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