[patch, fortran] Fix PR 42131, improvement in do loops

Jerry DeLisle jvdelisle@verizon.net
Tue Dec 1 13:52:00 GMT 2009


On 11/30/2009 11:18 PM, Thomas Koenig wrote:
> On Mon, 2009-11-30 at 14:08 -0800, Richard Henderson wrote:
>> On 11/30/2009 11:22 AM, Thomas Koenig wrote:
>>> P.S: Richard, if you have a suggestion along the lines of what
>>> you proposed in http://gcc.gnu.org/bugzilla/process_bug.cgi#c22 ,
>>> please don't hesitate to say so.
>>
>> Richi had meant
>>
>>     step_sign = fold_build3 (COND_EXPR, type,
>> 		fold_build2 (LT_EXPR, boolean_type_node, step,
>> 			     build_int_cst (type, 0)),
>>                   build_int_cst (type, -1), build_int_cst (type, 1));
>>
>> I.e. "step_size = (step<  0 ? -1 : 1)".
>
> That would have worked as well, also for folding, I see.  I am a bit
> surprised because the version with the if didn't work.
>
> If anybody shows that this version is better than what I committed, this
> is a trivial enough change that can be done easily.
>
> 	Thomas
>
>
Thomas, you are approved to change this on trunk.  It does seem cleaner, simpler.

Jerry



More information about the Gcc-patches mailing list