This is the mail archive of the gcc-patches@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]

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)


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