This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR rtl-optimization/26244 (incorrect shift optimization)
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: roger at eyesopen dot com (Roger Sayle)
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 3 Aug 2006 11:34:44 -0400 (EDT)
- Subject: Re: PR rtl-optimization/26244 (incorrect shift optimization)
> So I think the correct thing to do, is follow this prescribed logic
> in cse.c. If we CSE a negative constant, we either skip attempts
> to associate it on !SHIFT_COUNT_TRUNCATED targets, or canonicalize
> the result to be 0 <= new_const < GET_MODE_BITSIZE to avoid introducing
> any new undefined behaviour.
>
> So I think the correct solution is something like the patch below:
> My apologies for the minor reformatting clean-ups, force of habit.
Thanks for reworking the change. My impression is that it will
resolve the problem. I'll retest, add a ChangeLog entry, and install
if that's ok.
Have a great vacation!
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)