repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
torture
/
pr62175.C
blob
bcdea61e1bfbef836303cf41e7388202c37614ec
1
// { dg-do compile }
2
// { dg-additional-options "-ftrapv" }
3
4
struct B {
5
B(int = 0);
6
};
7
int c;
8
int *d;
9
struct G {
10
G();
11
int numProcs_;
12
};
13
int fn1();
14
B fn2() {
15
if (c)
16
return 0;
17
return B();
18
}
19
20
long &fn3(long &p1, long &p2) {
21
if (p2 < p1)
22
return p2;
23
return p1;
24
}
25
26
void fn4(long p1) {
27
long a = fn1();
28
fn2();
29
int b = fn3(p1, a);
30
for (int i; i < b; ++i)
31
d[0] = 0;
32
for (; a < p1; ++a)
33
d[a] = 0;
34
}
35
36
G::G() { fn4(numProcs_ + 1); }