+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
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.
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
{
return &i ? i : 0;
}
+
+/* { dg-error "PTX does not support weak declarations" "" { target nvptx-*-* } 5 } */
--- /dev/null
+
+extern int __attribute__((weak)) decl; /* { dg-error "weak declarations" } */
+int __attribute__((weak)) defn;
+
+int Foo ()
+{
+ return decl + defn;
+}
+