[Bug tree-optimization/86010] [7/8/9 Regression] redundant memset with smaller size not eliminated

2018-12-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86010

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|7.4 |7.5

[Bug tree-optimization/86010] [7/8/9 Regression] redundant memset with smaller size not eliminated

2018-08-28 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86010

--- Comment #9 from Jeffrey A. Law  ---
We don't merge the two memset calls in the second example.  It's of arguable
value IMHO.

[Bug tree-optimization/86010] [7/8/9 Regression] redundant memset with smaller size not eliminated

2018-08-27 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86010

--- Comment #8 from Martin Sebor  ---
I believe the fix is behind the regression reported in pr87011.

[Bug tree-optimization/86010] [7/8/9 Regression] redundant memset with smaller size not eliminated

2018-08-27 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86010

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #7 from Jakub Jelinek  ---
So fixed for 9+?

[Bug tree-optimization/86010] [7/8/9 Regression] redundant memset with smaller size not eliminated

2018-07-17 Thread law at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86010

--- Comment #6 from Jeffrey A. Law  ---
Author: law
Date: Tue Jul 17 23:54:10 2018
New Revision: 262841

URL: https://gcc.gnu.org/viewcvs?rev=262841=gcc=rev
Log:
PR tree-optimization/86010
* tree-ssa-dse.c (compute_trims): Fix typo/thinko.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-ssa-dse.c

[Bug tree-optimization/86010] [7/8/9 Regression] redundant memset with smaller size not eliminated

2018-07-05 Thread law at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86010

--- Comment #5 from Jeffrey A. Law  ---
Author: law
Date: Fri Jul  6 03:43:42 2018
New Revision: 262464

URL: https://gcc.gnu.org/viewcvs?rev=262464=gcc=rev
Log:
PR tree-optimization/86010
* tree-ssa-dse.c (compute_trims): More aggressively trim at
both the head and tail of mem* and str* calls.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-ssa-dse.c

[Bug tree-optimization/86010] [7/8/9 Regression] redundant memset with smaller size not eliminated

2018-07-05 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86010

--- Comment #4 from Jeffrey A. Law  ---
Actually, alignment considerations are really just for head trimming.  When
trimming the tail we can be more aggressive as residuals are usually handled
reasonably efficiently.

[Bug tree-optimization/86010] [7/8/9 Regression] redundant memset with smaller size not eliminated

2018-07-05 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86010

--- Comment #3 from Jeffrey A. Law  ---
It's not an off by 1 error, but a conscious decision to not pass odd addresses
into the mem* routines, which are typically doing to emit crappy code for badly
aligned data.

We correctly see that 7 bytes of data are live and that we only need a single
byte write for the first memset.  One could certainly argue that in the case
were a single byte (or even perhaps up to 3 bytes) are all that's left that we
should do a full trim because the first mem* routine should end up open-coded.

If I hack something like that together we end up with:

  MEM[(void *) + 7B] = 0;
  __builtin_memset (, 0, 7);
  f ();
  a ={v} {CLOBBER};
  return;


THe fact that the two memset calls use the same value is a testsuite quirk that
would allow this to be further optimized.  I'm skeptical that happens often
enough in practice to be worth optimizing.   If someone were to want to
optimize that better, I'd think the strlen pass is probably the right place.

[Bug tree-optimization/86010] [7/8/9 Regression] redundant memset with smaller size not eliminated

2018-06-01 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86010

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-06-01
 CC||law at gcc dot gnu.org
  Known to work||4.8.5
   Target Milestone|--- |7.4
Summary|[7/8 Regression] redundant  |[7/8/9 Regression]
   |memset with smaller size|redundant memset with
   |not eliminated  |smaller size not eliminated
 Ever confirmed|0   |1

--- Comment #2 from Richard Biener  ---
This is the new byte-tracking in DSE I presume which isn't able to prune
optimally (off-by-one?) or do the better thing, namely removing the
later memset instead of the earlier.  With GCC 4.8 we managed to combine
the memsets at the RTL level.