[patch, libfortran] [4.7/4.8/4.9 Regression] PR38199 missed optimization: I/O performance

Jerry DeLisle jvdelisle@charter.net
Sat Mar 8 20:13:00 GMT 2014


On 03/08/2014 04:58 AM, Steven Bosscher wrote:
> On Sat, Mar 8, 2014 at 7:38 AM, Jerry DeLisle wrote:
>> The speedup is accomplished by simply skipping over spaces without calling
>> next_read, then backing up one character and letting the existing execution path
>> proceed, preserving all the end of record code needed in next_char.
>>
>> I also remove some unneeded error checks.
> 
> Would it be enough to make them "unlikely" instead?
> 
> -      if (length < 0)
> +      if (unlikely(length < 0))
> 

Here is the revised patch leaving the error checks in place and using unlikely().

I have also added handling of kind=4 character arrays.

Regression tested on x86-64.

OK for trunk?

Jerry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr38199-A.diff
Type: text/x-patch
Size: 2463 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20140308/2319007d/attachment.bin>


More information about the Fortran mailing list