[Bug tree-optimization/94130] [8 Regression] Unintended result with optimization option when assigning two structures, memset and 0

2021-03-06 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94130

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jonathon.reinhart at gmail dot 
com

--- Comment #14 from Jakub Jelinek  ---
*** Bug 99431 has been marked as a duplicate of this bug. ***

[Bug tree-optimization/94130] [8 Regression] Unintended result with optimization option when assigning two structures, memset and 0

2020-09-17 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94130

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #13 from Jakub Jelinek  ---
Fixed for 8.5 too.

[Bug tree-optimization/94130] [8 Regression] Unintended result with optimization option when assigning two structures, memset and 0

2020-09-17 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94130

--- Comment #12 from CVS Commits  ---
The releases/gcc-8 branch has been updated by Jakub Jelinek
:

https://gcc.gnu.org/g:9001bc36447e015283a5f1a0a924bd355f9d9df3

commit r8-10463-g9001bc36447e015283a5f1a0a924bd355f9d9df3
Author: Jakub Jelinek 
Date:   Thu Mar 12 09:34:00 2020 +0100

tree-dse: Fix mem* head trimming if call has lhs [PR94130]

As the testcase shows, if DSE decides to head trim
{mem{set,cpy,move},strncpy}
and the call has lhs, it is incorrect to leave the lhs as is, because it
will then point to the adjusted address (base + head_trim) instead of the
original base.
The following patch fixes that by dropping the lhs of the call and
assigning
lhs the original base in a following statement.

2020-03-12  Jakub Jelinek  

PR tree-optimization/94130
* tree-ssa-dse.c: Include gimplify.h.
(increment_start_addr): If stmt has lhs, drop the lhs from call and
set it after the call to the original value of the first argument.
Formatting fixes.
(decrement_count): Formatting fix.

* gcc.c-torture/execute/pr94130.c: New test.

(cherry picked from commit a545ffafa380fa958393e1dfbf7f5f8f129bc5cf)

[Bug tree-optimization/94130] [8 Regression] Unintended result with optimization option when assigning two structures, memset and 0

2020-03-17 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94130

Jakub Jelinek  changed:

   What|Removed |Added

Summary|[8/9 Regression] Unintended |[8 Regression] Unintended
   |result with optimization|result with optimization
   |option when assigning two   |option when assigning two
   |structures, memset and 0|structures, memset and 0

--- Comment #11 from Jakub Jelinek  ---
Fixed for 9.4+ too.