diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-06-01 13:41:19 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-06-01 13:41:19 +0000 |
commit | d27a79f630f398e17a4b87b5e6bb72bbd133f9fd (patch) | |
tree | 0270e63a4aa754558715246d21d96aae3d490878 /gcc/config/nvptx/nvptx.c | |
parent | 6172a9fd80d3f02a7992398d9e3d5fb35b577a61 (diff) | |
download | gcc-d27a79f630f398e17a4b87b5e6bb72bbd133f9fd.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@236990 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/nvptx/nvptx.c')
-rw-r--r-- | gcc/config/nvptx/nvptx.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c index 1bd18710245..6c78699d75f 100644 --- a/gcc/config/nvptx/nvptx.c +++ b/gcc/config/nvptx/nvptx.c @@ -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 "); |