[Bug middle-end/86121] [9 Regression] missing -Wstringop-overflow on strcpy followed by strcat
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jun 12 17:58:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86121
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
The problem is due to the MEM_REF that the strcat() call is transformed into.
Prior to GCC 9 the strcat() call would be transformed to memcpy() like so:
MEM[(char * {ref-all})&a] = MEM[(char * {ref-all})"12"];
__builtin_memcpy (&MEM[(void *)&a + 2B], "3", 2); [tail call]
Bisection points to the following commit as the cause of the change:
r261061 | rguenth | 2018-06-01 06:49:54 -0400 (Fri, 01 Jun 2018) | 8 lines
2018-06-01 Richard Biener <rguenther@suse.de>
PR middle-end/86017
* gimple-fold.c (var_decl_component_p): Also allow offsetted
vars wrapped in MEM_REFs.
* gcc.dg/tree-ssa/pr86017.c: New testcase.
More information about the Gcc-bugs
mailing list