public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/83907] missing strlen optimization for non-zero memset followed by a nul byte store
       [not found] <bug-83907-4@http.gcc.gnu.org/bugzilla/>
@ 2022-02-20 17:01 ` roger at nextmovesoftware dot com
  2022-05-13 21:21 ` cvs-commit at gcc dot gnu.org
  2022-05-15 22:06 ` roger at nextmovesoftware dot com
  2 siblings, 0 replies; 3+ messages in thread
From: roger at nextmovesoftware dot com @ 2022-02-20 17:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83907

Roger Sayle <roger at nextmovesoftware dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-02-20
             Status|UNCONFIRMED                 |ASSIGNED
                 CC|                            |roger at nextmovesoftware dot com
           Assignee|unassigned at gcc dot gnu.org      |roger at nextmovesoftware dot com

--- Comment #1 from Roger Sayle <roger at nextmovesoftware dot com> ---
Patch proposed.
https://gcc.gnu.org/pipermail/gcc-patches/2022-February/590619.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug tree-optimization/83907] missing strlen optimization for non-zero memset followed by a nul byte store
       [not found] <bug-83907-4@http.gcc.gnu.org/bugzilla/>
  2022-02-20 17:01 ` [Bug tree-optimization/83907] missing strlen optimization for non-zero memset followed by a nul byte store roger at nextmovesoftware dot com
@ 2022-05-13 21:21 ` cvs-commit at gcc dot gnu.org
  2022-05-15 22:06 ` roger at nextmovesoftware dot com
  2 siblings, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-13 21:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83907

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Roger Sayle <sayle@gcc.gnu.org>:

https://gcc.gnu.org/g:1fe04c497d5a16baee6af48a0b08ca99b75724e4

commit r13-455-g1fe04c497d5a16baee6af48a0b08ca99b75724e4
Author: Roger Sayle <roger@nextmovesoftware.com>
Date:   Fri May 13 22:20:16 2022 +0100

    PR tree-optimization/83907: Improved memset handling in strlen pass.

    This patch implements the missed optimization enhancement PR 83907,
    by handling memset with a constant byte value in tree-ssa's strlen
    optimization pass.  Effectively, this treats memset(dst,'x',3) as
    it would memcpy(dst,"xxx",3).

    This patch also includes a tweak to handle_store to address another
    missed optimization observed in the related test case pr83907-2.c.
    The consecutive byte stores to memory get coalesced into a vector
    write of a vector const, but unfortunately tree-ssa-strlen's
    handle_store didn't previously handle the (unusual) case where the
    stored "string" starts with a zero byte but also contains non-zero
    bytes.

    2022-05-13  Roger Sayle  <roger@nextmovesoftware.com>

    gcc/ChangeLog
            PR tree-optimization/83907
            * tree-ssa-strlen.cc (handle_builtin_memset): Record a strinfo
            for memset with an constant char value.
            (handle_store): Improved handling of stores with a first byte
            of zero, but not storing_all_zeros_p.

    gcc/testsuite/ChangeLog
            PR tree-optimization/83907
            * gcc.dg/tree-ssa/pr83907-1.c: New test case.
            * gcc.dg/tree-ssa/pr83907-2.c: New test case.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug tree-optimization/83907] missing strlen optimization for non-zero memset followed by a nul byte store
       [not found] <bug-83907-4@http.gcc.gnu.org/bugzilla/>
  2022-02-20 17:01 ` [Bug tree-optimization/83907] missing strlen optimization for non-zero memset followed by a nul byte store roger at nextmovesoftware dot com
  2022-05-13 21:21 ` cvs-commit at gcc dot gnu.org
@ 2022-05-15 22:06 ` roger at nextmovesoftware dot com
  2 siblings, 0 replies; 3+ messages in thread
From: roger at nextmovesoftware dot com @ 2022-05-15 22:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83907

Roger Sayle <roger at nextmovesoftware dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
      Known to work|                            |13.0
   Target Milestone|---                         |13.0
         Resolution|---                         |FIXED

--- Comment #3 from Roger Sayle <roger at nextmovesoftware dot com> ---
This should now be fixed on mainline.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-15 22:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-83907-4@http.gcc.gnu.org/bugzilla/>
2022-02-20 17:01 ` [Bug tree-optimization/83907] missing strlen optimization for non-zero memset followed by a nul byte store roger at nextmovesoftware dot com
2022-05-13 21:21 ` cvs-commit at gcc dot gnu.org
2022-05-15 22:06 ` roger at nextmovesoftware dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).