This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rtl-optimization/80501] [6/7/8 Regression] Wrong code w/ a signed char, a shift, and a conversion to int


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
First of all, this is a missed-optimization on the VRP side:
  # RANGE [0, 128] NONZERO 128
  _6 = _3 << 7;
  # RANGE ~[-127, -1] NONZERO 128
  _8 = (signed char) _6;
For arbitrary [0, 128] cast to signed char ~[-127, -1] is the right answer,
sure, but if we take into account also the nonzero bits part, we'd be much
better using [-128, 0] NONZERO 128 range.

I'll try to debug the combine issue.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]