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
This commit is contained in:
parent
15c671a79c
commit
ae578943c0
4 changed files with 36 additions and 5 deletions
|
@ -1,3 +1,9 @@
|
|||
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;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2 -fdump-tree-optimized" } */
|
||||
/* { dg-options "-O2 -fdump-tree-optimized -fcommon" } */
|
||||
|
||||
const int conststaticvariable;
|
||||
|
||||
|
|
|
@ -1,7 +1,21 @@
|
|||
/* { 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" } } */
|
||||
|
|
Loading…
Add table
Reference in a new issue