aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2006-06-05 02:28:20 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2006-06-05 02:28:20 +0000
commitffbf5f7f209643607a674cd6716be9caa2dbafef (patch)
tree924b2488af5a0fc59ff1ca0d068ce257c9299c48 /gcc/c-common.c
parent5c076987a461e1ae0e30d0d9e52aa4e1f15fb8a8 (diff)
downloadgcc-ffbf5f7f209643607a674cd6716be9caa2dbafef.zip
gcc-ffbf5f7f209643607a674cd6716be9caa2dbafef.tar.gz
gcc-ffbf5f7f209643607a674cd6716be9caa2dbafef.tar.bz2
re PR middle-end/27382 (ICE in c_common_truthvalue_conversion with label address)
PR middle-end/27382 * c-common.c (c_common_truthvalue_conversion): Explicitly check for LABEL_DECL before calling DECL_WEAK. PR c/27150 * c-typeck.c (build_binary_op): Likewise, explicitly check for LABEL_DECL and PARM_DECL. * gcc.dg/pr27150-1.c: New testcase. * gcc.dg/pr27382-1.c: New testcase. * gcc.dg/pr27382-2.c: New testcase. Co-Authored-By: Andrew Pinski <pinskia@physics.uc.edu> From-SVN: r114380
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 1fb5a6a..1cef321 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -2501,7 +2501,9 @@ c_common_truthvalue_conversion (tree expr)
{
tree inner = TREE_OPERAND (expr, 0);
if (DECL_P (inner)
- && (TREE_CODE (inner) == PARM_DECL || !DECL_WEAK (inner)))
+ && (TREE_CODE (inner) == PARM_DECL
+ || TREE_CODE (inner) == LABEL_DECL
+ || !DECL_WEAK (inner)))
{
/* Common Ada/Pascal programmer's mistake. We always warn
about this since it is so bad. */