From c316b5e4f1f7987e37641667fb47eb37f32f0e2b Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Tue, 25 Aug 2015 20:28:59 +0000 Subject: 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 --- gcc/varasm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gcc/varasm.c') 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); -- cgit v1.1