blob: 26aa5cd94e043e385e63bd2f5c78d01abee894be (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
! { dg-do run }
! { dg-options "-O -fdump-tree-original" }
! PR 40628 - optimize unnecessary TRIMs on assignment
program main
character(len=3) :: a
character(len=4) :: b,c
b = 'abcd'
a = trim(b)
c = trim(trim(a))
if (a /= 'abc') call abort
if (c /= 'abc') call abort
end program main
! { dg-final { scan-tree-dump-times "memmove" 2 "original" } }
! { dg-final { scan-tree-dump-times "string_trim" 0 "original" } }
! { dg-final { cleanup-tree-dump "original" } }
|