This is the mail archive of the
java-prs@gcc.gnu.org
mailing list for the Java project.
[Bug rtl-optimization/17731] sub-optimal code generated for left shift
- From: "rth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: java-prs at gcc dot gnu dot org
- Date: 29 Sep 2004 19:39:47 -0000
- Subject: [Bug rtl-optimization/17731] sub-optimal code generated for left shift
- References: <20040929175802.17731.tromey@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From rth at gcc dot gnu dot org 2004-09-29 19:39 -------
This will be done properly if SHIFT_COUNT_TRUNCATED is true.
The problem is that SHIFT_COUNT_TRUNCATED applies to *all* shifts and at
the given mode size. Which is not true for x86, since HImode shifts are
still masked to 31, not 15.
Ideally we'd extend Richard Sandiford's new target.shift_truncation_mask
such that it can replace SHIFT_COUNT_TRUNCATED.
In the short term, Java could examine shift_truncation_mask and avoid
creating the AND at the tree level in the first place.
Not sure whether "middle-end" or "rtl-opt" is a better category, but this
is definitely not target-specific and thus "target" doesn't apply.
--
What |Removed |Added
----------------------------------------------------------------------------
Component|target |rtl-optimization
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17731