From 887fc41aef53f51d5c528b689b5ff98b670d14ac Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Thu, 18 Apr 2002 01:05:23 -0700 Subject: [PATCH] 20020418-1.c: New test. 2002-04-18 David S. Miller * gcc.c-torture/execute/20020418-1.c: New test. From-SVN: r52461 --- gcc/testsuite/ChangeLog | 4 ++++ .../gcc.c-torture/execute/20020418-1.c | 24 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/execute/20020418-1.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3fb38ece2d4..6bb6b221771 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2002-04-18 David S. Miller + + * gcc.c-torture/execute/20020418-1.c: New test. + 2002-04-17 Jakub Jelinek * gcc.dg/20020416-1.c: New test. diff --git a/gcc/testsuite/gcc.c-torture/execute/20020418-1.c b/gcc/testsuite/gcc.c-torture/execute/20020418-1.c new file mode 100644 index 00000000000..953f96e86ae --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20020418-1.c @@ -0,0 +1,24 @@ +/* ifcvt accidently deletes a referenced label while generating + conditional traps on machines having such patterns */ + +struct foo { int a; }; + +void gcc_crash(struct foo *p) +{ + if (__builtin_expect(p->a < 52, 0)) + __builtin_trap(); + top: + p->a++; + if (p->a >= 62) + goto top; +} + +int main(void) +{ + struct foo x; + + x.a = 53; + gcc_crash(&x); + + exit (0); +}