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

Andrew Macleod <amacleod at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amacleod at redhat dot com

--- Comment #2 from Andrew Macleod <amacleod at redhat dot com> ---
Where is something suppose to happen?

After VRP2, we have:

Non-varying global ranges:
=========================:
a_3(D)  : [irange] long int [0, 65535] MASK 0xffff VALUE 0x0
b_4(D)  : [irange] long int [0, 65535] MASK 0xffff VALUE 0x0
_5  : [irange] long int [0, 65535] MASK 0xffff VALUE 0x0

Recording return range of test/1:[irange] long int [0, 65535] MASK 0xffff VALUE
0x0
long int test (long int a, long int b)
{
  long int _5;

  <bb 2> [local count: 1073741824]:
  _5 = a_3(D) / b_4(D);
  return _5;

}
And if I try int in GCC11, which is pre-ranger, I get:
Value ranges after VRP:

a_3(D): long int [0, 65535]
b_4(D): long int [0, 65535]
_5: long int [0, 65535]


Substituting values and folding statements

Folding statement: _5 = a_3(D) / b_4(D);
Not folded
Folding statement: return _5;
Not folded
long int test (long int a, long int b)
{
  long int _5;

  <bb 2> [local count: 1073741824]:
  _5 = a_3(D) / b_4(D);
  return _5;
}

And it still generates:
        movq    %rdi, %rax
        cqto
        idivq   %rsi
        ret

So I don't think we've lost any op narrowing code.

What are we suppose to do here?  I presume something is suppose to recognize
that with 2 32 bit inputs, the divide is suppose to be changed to something
else?

Reply via email to