public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/106754] New: compute_control_dep_chain over-estimates domain
@ 2022-08-26 11:33 rguenth at gcc dot gnu.org
  2022-09-06 12:56 ` [Bug tree-optimization/106754] " cvs-commit at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-08-26 11:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106754
           Summary: compute_control_dep_chain over-estimates domain
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

The following testcase shows compute_control_dep_chain for init_use_preds
of the 'return u' uninitialized use compute a path with w != 0 && v != 1,
leaving out the !(i < 10) loop exit predicate because of how the iteration
terminating condition on the post-dominator walk works.  While there's a
special case for the loop exit edge itself, the following if (y) z = 1;
intermediate post-dominator will still make the iteration terminate early
before reaching if (v != 1) and eventually the target block.  The parent
iteration which entered the loop will proceed to find that but the loop
exit condition will be lost.

extern unsigned bar (void);
extern void quux (void);
int z;
unsigned foo (unsigned v, int y, int w)
{
  unsigned u;
  if (v != 1)
    u = bar ();

  // This variantion from uninit-pred-11.c causes compute_control_dep_chain
  // to run into a defect, producing z != 0 && v != 1, omitting !(i<10)
  // from the path predicate
  if (w)
    {
      for (int i = 0; i < 10; i++)
        quux ();

      if (y)
        z = 1;
      if (v != 1)
        return u;
    }

  return 0;
}

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

end of thread, other threads:[~2022-11-28 22:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-26 11:33 [Bug tree-optimization/106754] New: compute_control_dep_chain over-estimates domain rguenth at gcc dot gnu.org
2022-09-06 12:56 ` [Bug tree-optimization/106754] " cvs-commit at gcc dot gnu.org
2022-09-06 12:56 ` rguenth at gcc dot gnu.org
2022-11-22 10:15 ` vincent-gcc at vinc17 dot net
2022-11-28 22:36 ` pinskia 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).