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

Daniel Henrique Barboza <daniel.barboza at oss dot qualcomm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.barboza at oss dot 
qualcomm
                   |                            |.com

--- Comment #12 from Daniel Henrique Barboza <daniel.barboza at oss dot 
qualcomm.com> ---
I tried to tackle this one by implementing the enhancements Andrew suggested in
comment #10.  There was definitely an improvement (in fact I just sent both to
the ML) but the problem still persists.

I saw an opportunity to solve the problem by making a transformation in this
following if:

  c.2_28 = c;
  _29 = (char) c.2_28;
  _30 = (int) _29;
  if (_29 >= 0)
    goto <bb 8>; [59.00%]
  else
    goto <bb 7>; [41.00%]

Note that _29 is a char cast to 'c'.  If we simplify the if to remove the cast
we can get the desired result, but this transformation is unsafe (it's an int
-> char).  I talked with Andrew offline and there is a way of making this
transformation safe by using range_fits_type_p, but that requires ranger info
that we don't have.

Reply via email to