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: [PATCH] Fix A < 0 ? <sign bit of A> : 0 optimization (PR middle-end/29695)


On Fri, 3 Nov 2006, Jakub Jelinek wrote:
> 2006-11-03  Jakub Jelinek  <jakub@redhat.com>
>
> 	PR middle-end/29695
> 	* fold-const.c (fold_ternary): Fix A < 0 ? <sign bit of A> : 0
> 	simplification.
>
> 	* gcc.c-torture/execute/pr29695-1.c: New test.
> 	* gcc.c-torture/execute/pr29695-2.c: New test.

This is OK for mainline, and affected branches.  Thanks.


I do appreciate the extra effort you've gone to, identifing and
implementing the situations where this transformation is valid based
upon sign or zero extension.  A lesser fix would have been to simply
limit this transformation to the case where A and <sign bit of A>
have the same size/type.  Thanks again for going the extra mile,
and generalizing this optimization.

Roger
--


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