This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] avoid false negatives in attr-nonstring-3.c (PR 83131)
- From: Jeff Law <law at redhat dot com>
- To: Martin Sebor <msebor at gmail dot com>, Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 18 Dec 2017 16:06:21 -0700
- Subject: Re: [PATCH] avoid false negatives in attr-nonstring-3.c (PR 83131)
- Authentication-results: sourceware.org; auth=none
- References: <bb57fb9f-054b-b601-c062-63a785501152@gmail.com>
On 12/11/2017 03:54 PM, Martin Sebor wrote:
> The attr-nonstring-3.c test fails on targets that expand
> the calls to some of the tested string functions in builtins.c,
> before they reach the checker in calls.c. The failures were
> reported on powrrpc64le but tests can be constructed that fail
> even on other targets (including x86_64).
>
> To fix these failures the checker needs to be invoked both
> in builtins.c when the expansion takes place and in calls.c
> otherwise.
>
> The attached patch does that. Since it also adjusts
> the indentation in the changed functions, I used diff -w
> to leave the whitespace changes out of it.
>
> Bootstrapped and tested on x86_64-linux. I verified the tests
> pass using a powerpc64le-linux cross-compiler.
>
> Martin
>
> gcc-83131.diff-w
>
>
> PR testsuite/83131 - c-c++/common/attr-nonstring-3 failure for strcmp tests on PowerPC
>
> gcc/ChangeLog:
>
> PR testsuite/83131
> * builtins.c (expand_builtin_strlen): Use get_callee_fndecl.
> (expand_builtin_strcmp): Call maybe_warn_nonstring_arg.
> (expand_builtin_strncmp): Same.
>
> gcc/testsuite/ChangeLog:
>
> PR testsuite/83131
> * c-c++-common/attr-nonstring-4.c: New test.
OK. Thanks for the -w output, it certainly makes this one easier to read.
jeff