[Patch, fortran] Use memcmp for string comparisons a bit more

Tobias Burnus burnus@net-b.de
Fri Mar 29 21:55:00 GMT 2013


Am 29.03.2013 21:53, schrieb Thomas Koenig:
> Am 29.03.2013 15:56, schrieb Tobias Burnus:
>>
>> Thus, how about using memcmp for kind=4 for == and /= only - and for
>> kind=1 also for <, > etc.?
>
> OK, there is the updated patch.

OK thanks for the patch!

> 2013-03-25  Thomas Koenig <tkoenig@gcc.gnu.org>
>
>         * trans-expr.c (build_memcmp_call):  New function.
>         (gfc_build_compare_string):  If the strings
>         compared have constant and equal lengths and
>         the strings are kind=1, or (for kind=4) strings,
>         the test is for (in)equality, use memcmp().

Somehow the commas and parentheses look odd. Shouldn't that be, e.g., 
"or (for kind=4 strings) the ..."?

Tobias



More information about the Gcc-patches mailing list