aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/pr29902.C
blob: 838a41169ad1b537782954bd13a132973f029daa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do compile { target i?86-*-* } } */
/* { dg-options "-O1 -fprefetch-loop-arrays -march=athlon" } */
/* { dg-require-effective-target ilp32 } */

int length1();
int g(int);
void f(int capacity_, char *old_storage)
{
  try {
      length1();
      int old_capacity = capacity_;
      capacity_ *= 2;
      g(capacity_);
      for (int i = 1; i < old_capacity; i++)
	old_storage[i] = old_storage[i - 1];
  } catch (...) {
      for (int i = 1; i < capacity_; i++){old_storage[i] = 0;}
  }
}