diff options
author | Jakub Jelinek <jakub@redhat.com> | 2009-01-03 01:52:51 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2009-01-03 01:52:51 +0100 |
commit | 5f26a23027acae2712001616c4b13c76cf316cd5 (patch) | |
tree | 86cded00cdc605437b4b88313a78ce8f36fa1dbd /gcc/builtins.c | |
parent | fafe34f91a12944c20cd13bd403ee2111ed19ff7 (diff) | |
download | gcc-5f26a23027acae2712001616c4b13c76cf316cd5.zip gcc-5f26a23027acae2712001616c4b13c76cf316cd5.tar.gz gcc-5f26a23027acae2712001616c4b13c76cf316cd5.tar.bz2 |
re PR c/38700 (ICE with __builtin_expect and label)
PR c/38700
* builtins.c (fold_builtin_expect): Only check DECL_WEAK for VAR_DECLs
and FUNCTION_DECLs.
* gcc.dg/pr38700.c: New test.
From-SVN: r143028
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index 607d7dd..cda94c3 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -1,6 +1,6 @@ /* Expand builtin functions. Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of GCC. @@ -7324,7 +7324,9 @@ fold_builtin_expect (tree arg0, tree arg1) } while (TREE_CODE (inner) == COMPONENT_REF || TREE_CODE (inner) == ARRAY_REF); - if (DECL_P (inner) && DECL_WEAK (inner)) + if ((TREE_CODE (inner) == VAR_DECL + || TREE_CODE (inner) == FUNCTION_DECL) + && DECL_WEAK (inner)) return NULL_TREE; } |