summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/reassoc_2.f90
blob: 053cb865f3ce2fefe999bd2da4cb7fc9303f7fa7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
! { dg-do compile }
! { dg-options "-O3 -ffast-math -fdump-tree-optimized" }

! Make sure that FRE does not replace c with b in d = c - 5

function test(a)
  real a, b, c, d
  b = a + 5.
  c = (a + 5.)
  d = c - 5.
  call foo(b)
  test = d
end

! { dg-final { scan-tree-dump "- 5" "optimized" } }
! { dg-final { cleanup-tree-dump "optimized" } }