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

Drea Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Target Milestone|---                         |17.0
   Last reconfirmed|                            |2026-08-12
            Summary|Missing or not complete     |[17 Regression] Missing or
                   |global range after VRP2     |not complete global range
                   |(with and without dom)      |after VRP2 (with and
                   |                            |without dom) since r17-1845
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot 
gnu.org

--- Comment #2 from Drea Pinski <pinskia at gcc dot gnu.org> ---
So the DCE issue is reassociation not removing statements no longer reference.

Let me look into that next.

Optimizing range tests i_4 +[, 99999] and +[0, 99999]
 into (unsigned int) i_4 <= 99999
Transforming _8 = _6 | _7;
 into _8 = _11;

Transforming:
  i.0_1 = (unsigned int) i_4;
  _6 = i.0_1 > 99999;
  _7 = i_4 > 99999;
  _8 = _6 | _7;

into:
  i.0_1 = (unsigned int) i_4;
  _6 = i.0_1 > 99999;
  _12 = (unsigned int) i_4;
  _11 = _12 > 99999;
  _7 = i_4 > 99999;
  _8 = _11;
  if (_8 != 0)

Looks like the reassociation issue is the issue with DOM too.


But there looks like a missing match pattern here for:
  i.0_1 = (unsigned int) i_4;
  _6 = i.0_1 > 99999;
  _7 = i_4 > 99999;
  _8 = _6 | _7;

into:
i.0_1 > 99999

Which would have fixed the issue too.

The missed optimization is also a regression. It was exposed by
r17-1845-g23b6a9a41a5c05 .

So I will implement two patches, one for the missed match pattern and one for
the reassociation.

Reply via email to