[Bug middle-end/85359] duplicate -Wstringop-overflow for a strcmp call with a nonstring pointer

2018-05-22 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85359

Martin Sebor  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Martin Sebor  ---
Adjusted patch committed in r260550.

[Bug middle-end/85359] duplicate -Wstringop-overflow for a strcmp call with a nonstring pointer

2018-05-22 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85359

--- Comment #3 from Martin Sebor  ---
Author: msebor
Date: Tue May 22 19:37:48 2018
New Revision: 260550

URL: https://gcc.gnu.org/viewcvs?rev=260550&root=gcc&view=rev
Log:
PR middle-end/85359 - duplicate -Wstringop-overflow for a strcmp call with a
nonstring pointer

gcc/ChangeLog:

PR middle-end/85359
* builtins.c (expand_builtin_strcpy): Call maybe_warn_nonstring_arg
only when expasion succeeds.
(expand_builtin_strcmp): Same.
(expand_builtin_strncmp): Same.

gcc/testsuite/ChangeLog:

PR middle-end/85359
* gcc.dg/attr-nonstring.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/attr-nonstring.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/builtins.c
trunk/gcc/calls.c
trunk/gcc/testsuite/ChangeLog

[Bug middle-end/85359] duplicate -Wstringop-overflow for a strcmp call with a nonstring pointer

2018-04-12 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85359

Martin Sebor  changed:

   What|Removed |Added

   Keywords||patch

--- Comment #2 from Martin Sebor  ---
Patch: https://gcc.gnu.org/ml/gcc-patches/2018-04/msg00639.html

[Bug middle-end/85359] duplicate -Wstringop-overflow for a strcmp call with a nonstring pointer

2018-04-12 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85359

Martin Sebor  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2018-04-12
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=85369
   Assignee|unassigned at gcc dot gnu.org  |msebor at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Martin Sebor  ---
I'm testing a fix for this.

See also bug 85369 for a related problem.