diff options
author | Marek Polacek <polacek@redhat.com> | 2015-08-25 20:28:59 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2015-08-25 20:28:59 +0000 |
commit | c316b5e4f1f7987e37641667fb47eb37f32f0e2b (patch) | |
tree | 06eefc14c8475e442a71d5919bce7072a7d7e3b2 /gcc/varasm.c | |
parent | 630a286ab6c4514c4cc4ff154cf68bf150f164f2 (diff) | |
download | gcc-c316b5e4f1f7987e37641667fb47eb37f32f0e2b.zip gcc-c316b5e4f1f7987e37641667fb47eb37f32f0e2b.tar.gz gcc-c316b5e4f1f7987e37641667fb47eb37f32f0e2b.tar.bz2 |
re PR middle-end/67330 (ICE handling weak attributes)
PR middle-end/67330
* varasm.c (declare_weak): Return after giving an error.
* c-common.c (handle_weak_attribute): Don't check whether the
visibility can be changed here.
* gcc.dg/weak/weak-18.c: New test.
From-SVN: r227190
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index 7fa2e7b..d9290a1 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -5403,7 +5403,10 @@ declare_weak (tree decl) { gcc_assert (TREE_CODE (decl) != FUNCTION_DECL || !TREE_ASM_WRITTEN (decl)); if (! TREE_PUBLIC (decl)) - error ("weak declaration of %q+D must be public", decl); + { + error ("weak declaration of %q+D must be public", decl); + return; + } else if (!TARGET_SUPPORTS_WEAK) warning (0, "weak declaration of %q+D not supported", decl); |