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

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> ---
This seems to be a good place to bring up a question I have.

What exactly do we want to with __builtin_unreachable across passes?

Ranger was initially starting with the previously set globally known value, and
I had to disable it for pr61034.C

Basically, the routine was pre-optimized and inlined, and inlining sets the
global range based on the output from the optimizations, and when ranger
removed the code with the unreachable in it, the testcase failed.

so 
void f(int n){
  if(n<0)__builtin_unreachable();
}
n has a global range of [0, +INF]

Is that the basic point of this?  Can we set the global range to that and
eliminate the if?

same thing for 
  if(*n<0)__builtin_unreachable();

I see:
    _1 = *n_3(D);
    if (_1 < 0)
      goto <bb 3>; [INV]
    else
      goto <bb 4>; [INV]

2->3  (T) _1 :  int [-INF, -1]
2->4  (F) _1 :  int [0, +INF]

=========== BB 3 ============
    <bb 3> :
    __builtin_unreachable ();

And we can know that _1 is [0, +INF] from then on. 

Can we kill all these unreachables() the first time we see them if we set the
range appropriately?

If not, at what point do we want to kill them?

Reply via email to