Commit 721547cd by Nathan Sidwell

nvptx.c (nvptx_assemble_undefined_decl): Reject undefined weak.

	* config/nvptx/nvptx.c (nvptx_assemble_undefined_decl): Reject
	undefined weak.

	testsuite/
	* c-c++-common/torture/pr57945.c: Add expected PTX error.
	* gcc.target/nvptx/weak.c: New.

From-SVN: r236990
parent fa2c9034
2016-06-01 Nathan Sidwell <nathan@acm.org>
* config/nvptx/nvptx.c (nvptx_assemble_undefined_decl): Reject
undefined weak.
2016-06-01 Richard Biener <rguenther@suse.de>
PR tree-optimization/71261
......@@ -109,7 +114,8 @@
2016-05-31 Oleg Endo <olegendo@gcc.gnu.org>
* config/sh/constraints.md (b): Remove constraint.
* config/sh/predicates.md (arith_reg_operand): Remove TARGET_REGISTER_P.
* config/sh/predicates.md (arith_reg_operand): Remove
TARGET_REGISTER_P.
* config/sh/sh-modes.def (PDI): Remove.
* config/sh/sh.c (sh_target_reg_class,
sh_optimize_target_register_callee_saved): Remove functions.
......
......@@ -1777,6 +1777,12 @@ nvptx_assemble_undefined_decl (FILE *file, const char *name, const_tree decl)
if (DECL_IN_CONSTANT_POOL (decl))
return;
/* We support weak defintions, and hence have the right
ASM_WEAKEN_DECL definition. Diagnose the problem here. */
if (DECL_WEAK (decl))
error_at (DECL_SOURCE_LOCATION (decl),
"PTX does not support weak declarations"
" (only weak definitions)");
write_var_marker (file, false, TREE_PUBLIC (decl), name);
fprintf (file, "\t.extern ");
......
2016-06-01 Nathan Sidwell <nathan@acm.org>
* c-c++-common/torture/pr57945.c: Add expected PTX error.
* gcc.target/nvptx/weak.c: New.
2016-06-01 Richard Biener <rguenther@suse.de>
PR tree-optimization/71261
......
......@@ -9,3 +9,5 @@ foo (void)
{
return &i ? i : 0;
}
/* { dg-error "PTX does not support weak declarations" "" { target nvptx-*-* } 5 } */
extern int __attribute__((weak)) decl; /* { dg-error "weak declarations" } */
int __attribute__((weak)) defn;
int Foo ()
{
return decl + 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