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

--- Comment #7 from Andrew Macleod <amacleod at redhat dot com> ---
Explicit casts would be no problem as they go through the proper machinery. The
IL for that case has an explicit cast in it.

  _1 = (int) x_2(D);
  foo (_1);

its when that cast is not present,and we try to, say subtract two values, that
we have a problem.  we expect the compiler to promote things to be compatible
when they are suppose to be. This would apply to dual operand arithmetic like
+, -, /, *, bitwise ops, etc.

The testcase in particular is a bitwise not... but it has a return type that is
64 bits and a operand type that is 32.  It was expected that the compiler would
promote the operand to 64 bits if it expects a 64 bit result. At least for
those tree codes which expect compatible types..

I don't think we want to get into overruling decisions at the range-ops level..
 So we decide whether to trap (which would be the same result as we see now
:-P), or handle it some other way.  returning VARYING was my thought.. because
it means something is amuck so say we dont know anything.

Alternatively, if IPA could figure out when things need promoting..  GCC must
already do it, although I suppose thats in the front ends :-P

Reply via email to