Commit 06118b14 by Thomas Koenig

re PR libfortran/52537 (slow trim function)

2012-05-11  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/52537
	* gfortran.dg/string_compare_4.f90:  Change option
	to -fdump-tree-original.  Add test case for kind=4.

From-SVN: r187413
parent dddb75f3
2012-05-11 Thomas Koenig <tkoenig@gcc.gnu.org> 2012-05-11 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/52537 PR fortran/52537
* gfortran.dg/string_compare_4.f90: Change option
to -fdump-tree-original. Add test case for kind=4.
2012-05-11 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/52537
* gfortran.dg/string_compare_4.f90: New test. * gfortran.dg/string_compare_4.f90: New test.
2012-05-11 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 2012-05-11 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
......
! { dg-do compile } ! { dg-do compile }
! { dg-options "-ffrontend-optimize -fdump-fortran-original" } ! { dg-options "-ffrontend-optimize -fdump-tree-original" }
! PR fortran/52537 - optimize comparisons with empty strings ! PR fortran/52537 - optimize comparisons with empty strings
program main program main
implicit none implicit none
character(len=10) :: a character(len=10) :: a
character(len=30) :: line character(len=30) :: line
character(len=4,kind=4) :: c4
line = 'x' line = 'x'
read (unit=line,fmt='(A)') a read (unit=line,fmt='(A)') a
c4 = 4_'foo'
if (c4 == 4_' ') print *,"foobar"
if (trim(a) == '') print *,"empty" if (trim(a) == '') print *,"empty"
call foo(a) call foo(a)
if (trim(a) == ' ') print *,"empty" if (trim(a) == ' ') print *,"empty"
...@@ -16,5 +19,5 @@ contains ...@@ -16,5 +19,5 @@ contains
if (b /= ' ') print *,"full" if (b /= ' ') print *,"full"
end subroutine foo end subroutine foo
end program main end program main
! { dg-final { scan-tree-dump-times "_gfortran_string_len_trim" 3 "original" } } ! { dg-final { scan-tree-dump-times "_gfortran_string_len_trim" 4 "original" } }
! { dg-final { cleanup-tree-dump "original" } } ! { dg-final { cleanup-tree-dump "original" } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment