[Bug middle-end/89934] [8 Regression] ICE on a call with fewer arguments to strncpy declared without prototype

2019-04-04 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89934

Martin Sebor  changed:

   What|Removed |Added

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

--- Comment #9 from Martin Sebor  ---
Patch backported to GCC 8 via r270153.

[Bug middle-end/89934] [8 Regression] ICE on a call with fewer arguments to strncpy declared without prototype

2019-04-04 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89934

--- Comment #8 from Martin Sebor  ---
Author: msebor
Date: Thu Apr  4 22:16:11 2019
New Revision: 270153

URL: https://gcc.gnu.org/viewcvs?rev=270153=gcc=rev
Log:
Backport from 9.0.

PR middle-end/89934 - ICE on a call with fewer arguments to strncpy declared
without prototype

gcc/ChangeLog:

PR middle-end/89934
* gimple-ssa-warn-restrict.c (builtin_access::builtin_access): Bail
out if the number of arguments is less than expected.

gcc/testsuite/ChangeLog:

PR middle-end/89934
* gcc.dg/Wrestrict-19.c: New test.
* gcc.dg/Wrestrict-5.c: Add comment.  Remove unused code.


Added:
branches/gcc-8-branch/gcc/testsuite/gcc.dg/Wrestrict-19.c
Modified:
branches/gcc-8-branch/gcc/ChangeLog
branches/gcc-8-branch/gcc/gimple-ssa-warn-restrict.c
branches/gcc-8-branch/gcc/testsuite/ChangeLog
branches/gcc-8-branch/gcc/testsuite/gcc.dg/Wrestrict-5.c

[Bug middle-end/89934] [8 Regression] ICE on a call with fewer arguments to strncpy declared without prototype

2019-04-04 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89934

Martin Sebor  changed:

   What|Removed |Added

Summary|[9 Regression] ICE on a |[8 Regression] ICE on a
   |call with fewer arguments   |call with fewer arguments
   |to strncpy declared without |to strncpy declared without
   |prototype   |prototype
  Known to fail||8.3.0

--- Comment #7 from Martin Sebor  ---
Fixed in GCC 9 in r270152.