This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/80501] [6/7/8 Regression] Wrong code w/ a signed char, a shift, and a conversion to int
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 24 Apr 2017 09:49:49 +0000
- Subject: [Bug rtl-optimization/80501] [6/7/8 Regression] Wrong code w/ a signed char, a shift, and a conversion to int
- Auto-submitted: auto-generated
- References: <bug-80501-4@http.gcc.gnu.org/bugzilla/>
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.