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

            Bug ID: 126110
           Summary: VRP does not optimize a gimple_assign like it does
                    GIMPLE_COND sometimes
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
            Blocks: 85316
  Target Milestone: ---

Created attachment 64937
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=64937&action=edit
testcase

Take the attached testcase which is a modified version of pr20701.c.

I would have assumed:
  # set_6 = PHI <insn_9(D)(2), elt_10(D)(3)>
  _5 = set_6 == 0B;
  # RANGE [irange] int [0, 1] MASK 0x1 VALUE 0x0
  _11 = (int) _5;

Would get optimized to _5 being 0 like in the GIMPLE_COND case but it does not.

In the GIMPLE_COND case we get:
Folding predicate set_5 == 0B to 0


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85316
[Bug 85316] [meta-bug] VRP range propagation missed cases

Reply via email to