annotate gcc/testsuite/gfortran.dg/trim_optimize_7.f90 @ 144:8f4e72ab4e11

fix segmentation fault caused by nothing next cur_op to end
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 21:23:56 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do run }
kono
parents:
diff changeset
2 ! { dg-options "-O -fdump-tree-original" }
kono
parents:
diff changeset
3 ! Check that trailing trims are also removed from assignment of
kono
parents:
diff changeset
4 ! expressions involving concatenations of strings .
kono
parents:
diff changeset
5 program main
kono
parents:
diff changeset
6 character(2) :: a,b,c
kono
parents:
diff changeset
7 character(8) :: d
kono
parents:
diff changeset
8 a = 'a '
kono
parents:
diff changeset
9 b = 'b '
kono
parents:
diff changeset
10 c = 'c '
kono
parents:
diff changeset
11 d = a // b // a // trim(c) ! This should be optimized away.
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
12 if (d /= 'a b a c ') STOP 1
111
kono
parents:
diff changeset
13 d = a // trim(b) // c // a ! This shouldn't.
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
14 if (d /= 'a bc a ') STOP 2
111
kono
parents:
diff changeset
15 d = a // b // a // trim(trim(c)) ! This should also be optimized away.
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
16 if (d /= 'a b a c ') STOP 3
111
kono
parents:
diff changeset
17 end
kono
parents:
diff changeset
18 ! { dg-final { scan-tree-dump-times "string_len_trim" 1 "original" } }