aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-09-20 15:48:40 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2016-09-20 15:48:40 +0200
commit7d9cf8015969054f044ee815f0308e7130c59b83 (patch)
tree0317661a91abecaca87f11977e90131e5694f151 /gcc/builtins.c
parent3aebb6ff7588a68535cbc3c865bb316d29932c7f (diff)
downloadgcc-7d9cf8015969054f044ee815f0308e7130c59b83.zip
gcc-7d9cf8015969054f044ee815f0308e7130c59b83.tar.gz
gcc-7d9cf8015969054f044ee815f0308e7130c59b83.tar.bz2
re PR middle-end/77624 (ICE on x86_64-linux-gnu (internal compiler error: in fold_builtin_atomic_always_lock_free, at builtins.c:5583))
PR middle-end/77624 * builtins.c (fold_builtin_atomic_always_lock_free): Only look through cast to void * if the cast is from some other pointer type. * c-c++-common/pr77624-1.c: New test. * c-c++-common/pr77624-2.c: New test. From-SVN: r240263
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 189aeac..9a19a75 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -5575,8 +5575,10 @@ fold_builtin_atomic_always_lock_free (tree arg0, tree arg1)
end before anything else has a chance to look at it. The pointer
parameter at this point is usually cast to a void *, so check for that
and look past the cast. */
- if (CONVERT_EXPR_P (arg1) && POINTER_TYPE_P (ttype)
- && VOID_TYPE_P (TREE_TYPE (ttype)))
+ if (CONVERT_EXPR_P (arg1)
+ && POINTER_TYPE_P (ttype)
+ && VOID_TYPE_P (TREE_TYPE (ttype))
+ && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (arg1, 0))))
arg1 = TREE_OPERAND (arg1, 0);
ttype = TREE_TYPE (arg1);