[Bug tree-optimization/126646] Umin(a,1) | umin(b,1) ->umin(a|b, 1)

"Reshma.Roy at amd dot com via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126646

Reshma Roy <Reshma.Roy at amd dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Reshma.Roy at amd dot com

--- Comment #1 from Reshma Roy <Reshma.Roy at amd dot com> ---
Confirmed on the gcc trunk gcc (GCC) 17.0.0 20260811 (experimental).

The gimple IR for the first case with -O2 is as follows:

unsigned int f (unsigned int a, unsigned int b)
{
  unsigned int _5; 

  <bb 2> [local count: 1073741824]:
  a_2 = MIN_EXPR <a_1(D), 1>; 
  b_4 = MIN_EXPR <b_3(D), 1>; 
  _5 = a_2 | b_4;
  return _5; 
}

Here there are two MIN_EXPR.

The gimple IR for the second snippet has only one MIN_EXPR:

unsigned int g (unsigned int a, unsigned int b)
{
  unsigned int _4; 

  <bb 2> [local count: 1073741824]:
  a_3 = a_1(D) | b_2(D);
  _4 = MIN_EXPR <a_3, 1>; 
  return _4; 

}

The MIN_EXPR survives into tree-ssa so this needs a match.pd pattern. 

Can this be assigned to me?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.