This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/80131] powerpc: 1U << (31 - x) doesn't generate optimised code
- From: "segher at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 21 Mar 2017 15:58:33 +0000
- Subject: [Bug middle-end/80131] powerpc: 1U << (31 - x) doesn't generate optimised code
- Auto-submitted: auto-generated
- References: <bug-80131-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80131
Segher Boessenkool <segher at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |segher at gcc dot gnu.org
--- Comment #2 from Segher Boessenkool <segher at gcc dot gnu.org> ---
It may be best to do this in combine.
If we have d = a << (b - c); and a << b does not truncate in the
original mode, write it as d := (a << b) >> c; instead (and then
see if it is actually cheaper, as combine always does).