diff options
author | Jakub Jelinek <jakub@redhat.com> | 2018-03-20 08:55:41 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2018-03-20 08:55:41 +0100 |
commit | a8ed1cbd67ebb44c14f65432524892b384ba11e9 (patch) | |
tree | 7b0cddb9d6b428718734ecc904b047f3c7e35013 /gcc/builtins.c | |
parent | d2a1b11e65ed693af10ecae1b0c48b23e6e097fa (diff) | |
download | gcc-a8ed1cbd67ebb44c14f65432524892b384ba11e9.zip gcc-a8ed1cbd67ebb44c14f65432524892b384ba11e9.tar.gz gcc-a8ed1cbd67ebb44c14f65432524892b384ba11e9.tar.bz2 |
re PR c/84953 (misleading warning from strpbrk(x,""))
PR c/84953
* builtins.c (fold_builtin_strpbrk): For strpbrk(x, "") use type
instead of TREE_TYPE (s1) for the return value.
* gcc.dg/pr84953.c: New test.
From-SVN: r258671
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index 85affa7..487d9d5 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -9573,7 +9573,7 @@ fold_builtin_strpbrk (location_t loc, tree s1, tree s2, tree type) if (p2[0] == '\0') /* strpbrk(x, "") == NULL. Evaluate and ignore s1 in case it had side-effects. */ - return omit_one_operand_loc (loc, TREE_TYPE (s1), integer_zero_node, s1); + return omit_one_operand_loc (loc, type, integer_zero_node, s1); if (p2[1] != '\0') return NULL_TREE; /* Really call strpbrk. */ |