trans-expr.c (build_memcmp_call): New function.
authorThomas Koenig <tkoenig@gcc.gnu.org>
Sat, 30 Mar 2013 10:19:02 +0000 (10:19 +0000)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Sat, 30 Mar 2013 10:19:02 +0000 (10:19 +0000)
commit01446eb82c798ed19f8930dd3470f9d77522c22e
tree2268fa99cea63797dc549729fa965505d884280a
parent032951216cf00d9609fbba89186331bd7b4d9efd
trans-expr.c (build_memcmp_call): New function.

2013-03-30  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().

2013-03-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

* gfortran.dg/character_comparison_3.f90:  Adjust for use of memcmp
for constant and equal string lengths.
* gfortran.dg/character_comparison_5.f90:  Likewise.
* gfortran.dg/character_comparison_9.f90:  New test.

From-SVN: r197261
gcc/fortran/trans-expr.c
gcc/testsuite/gfortran.dg/character_comparison_3.f90
gcc/testsuite/gfortran.dg/character_comparison_5.f90
gcc/testsuite/gfortran.dg/character_comparison_9.f90 [new file with mode: 0644]