[Bug tree-optimization/61410] [4.7 Regression] strcat overwrites destination string when compiling with optimizations
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jun 4 10:30:00 GMT 2014
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61410
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Known to work| |4.6.4, 4.8.1
Keywords| |wrong-code
Last reconfirmed| |2014-06-04
Ever confirmed|0 |1
Summary|strcat overwrites |[4.7 Regression] strcat
|destination string when |overwrites destination
|compiling with |string when compiling with
|optimizations |optimizations
Target Milestone|--- |4.7.4
Known to fail| |4.7.0, 4.7.3, 4.8.0
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed anyway, this was fixed between 4.8.0 and 4.8.1. Bug in strlen pass:
Optimizing: D.2544_1 = __builtin_strlen (&str);
into: D.2544_1 = 0;
main ()
{
char str[250];
char * D.2545;
long unsigned int D.2544;
<bb 2>:
__builtin_memcpy (&str, " ", 2);
str[0] = 95;
D.2544_1 = 0;
D.2545_2 = &str + D.2544_1;
__builtin_memcpy (D.2545_2, ",", 2);
puts (&str);
looks like PR57230 missed a 4.7 backport.
More information about the Gcc-bugs
mailing list