PR middle-end/89957 - ICE calling strnlen with an int128_t bound in a known range
authorMartin Sebor <msebor@redhat.com>
Thu, 4 Apr 2019 22:38:10 +0000 (22:38 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Thu, 4 Apr 2019 22:38:10 +0000 (16:38 -0600)
commit1a9b15a7d76ee3ee2cd960698a84e34ec10c2bf0
treeb55605cb740d88748c0349945fe87a7b06634d12
parent9a0cbb60d28042893135cee60ad28a48a7e2235d
PR middle-end/89957 - ICE calling strnlen with an int128_t bound in a known range

PR middle-end/89957 - ICE calling strnlen with an int128_t bound in a known range
PR middle-end/89911 - [9 Regression] ICE in get_attr_nonstring_decl

gcc/ChangeLog:

PR middle-end/89957
PR middle-end/89911
* builtins.c (expand_builtin_strnlen): Make sure wi::ltu_p operands
have the same precision since the function crashes otherwise.
* calls.c (maybe_warn_nonstring_arg): Avoid assuming strnlen() call
has non-zero arguments.

gcc/testsuite/ChangeLog:

PR middle-end/89957
PR middle-end/89911
* gcc.dg/Wstringop-overflow-13.c: New test.

From-SVN: r270154
gcc/ChangeLog
gcc/builtins.c
gcc/calls.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/Wstringop-overflow-13.c [new file with mode: 0644]