public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/102864] New: no out of bounds warning for DCE code
@ 2021-10-21  1:52 pinskia at gcc dot gnu.org
  2021-10-21  6:30 ` [Bug tree-optimization/102864] " rguenth at gcc dot gnu.org
  2021-10-21  8:20 ` cvs-commit at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-10-21  1:52 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102864
           Summary: no out of bounds warning for DCE code
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take:
int f(void)
{
  int t[4]={0,0,0,0};
  int t2 = 5;
  int tt, tt1;
  tt = t[t2];
  tt1 = tt;
  return tt-tt1;
}

There is no out of bounds warning for the t[t2] access because the code is all
dead.

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

* [Bug tree-optimization/102864] no out of bounds warning for DCE code
  2021-10-21  1:52 [Bug tree-optimization/102864] New: no out of bounds warning for DCE code pinskia at gcc dot gnu.org
@ 2021-10-21  6:30 ` rguenth at gcc dot gnu.org
  2021-10-21  8:20 ` cvs-commit at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-10-21  6:30 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |WONTFIX
             Status|UNCONFIRMED                 |RESOLVED
           Severity|normal                      |enhancement

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
So?

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

* [Bug tree-optimization/102864] no out of bounds warning for DCE code
  2021-10-21  1:52 [Bug tree-optimization/102864] New: no out of bounds warning for DCE code pinskia at gcc dot gnu.org
  2021-10-21  6:30 ` [Bug tree-optimization/102864] " rguenth at gcc dot gnu.org
@ 2021-10-21  8:20 ` cvs-commit at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-21  8:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <pinskia@gcc.gnu.org>:

https://gcc.gnu.org/g:113860301f46d14a255bd947d18d36f917527230

commit r12-4598-g113860301f46d14a255bd947d18d36f917527230
Author: Andrew Pinski <apinski@marvell.com>
Date:   Sat Oct 16 04:14:57 2021 +0000

    Improve maybe_remove_writeonly_store to do a simple DCE for defining
statement

    Instead of putting a full blow DCE after execute_fixup_cfg, it makes sense
    to try to remove the defining statement for the store that is being
removed.
    Using simple_dce_from_worklist makes this easier, just mark the ssa_name on
    the rhs side of the store (if it was one) in a bitmap and then call
    simple_dce_from_worklist at the end.

    gcc.dg/pr36902.c needed to be changed such that the static array was no
    longer a static array but a global array.  This is because this new dce
    will remove the load as it is dead. I also filed PR 102864 for the warning
    on dead loads.

    gcc/ChangeLog:

            * tree-cfg.c (maybe_remove_writeonly_store): Add dce_ssa_names
argument.
            Mark the ssa-name of the rhs as one to be removed.
            (execute_fixup_cfg): Update call to maybe_remove_writeonly_store.
            Call simple_dce_from_worklist at the end to a simple dce.

    gcc/testsuite/ChangeLog:

            * gcc.dg/pr36902.c: Move buf to be a non-static variable.

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

end of thread, other threads:[~2021-10-21  8:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-21  1:52 [Bug tree-optimization/102864] New: no out of bounds warning for DCE code pinskia at gcc dot gnu.org
2021-10-21  6:30 ` [Bug tree-optimization/102864] " rguenth at gcc dot gnu.org
2021-10-21  8:20 ` cvs-commit at gcc dot gnu.org

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).