diff options
author | Eric Botcazou <ebotcazou@libertysurf.fr> | 2003-12-23 06:32:02 +0100 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2003-12-23 05:32:02 +0000 |
commit | cbf6e52aa53df8528eb21cff83631a0523cae79c (patch) | |
tree | 88603b729da510442c9773f6f802871336123067 /gcc/testsuite | |
parent | b30063377737ba34e9ace3ce285d3bc2eb14d1a3 (diff) | |
download | gcc-cbf6e52aa53df8528eb21cff83631a0523cae79c.zip gcc-cbf6e52aa53df8528eb21cff83631a0523cae79c.tar.gz gcc-cbf6e52aa53df8528eb21cff83631a0523cae79c.tar.bz2 |
re PR rtl-optimization/13394 (noreturn attribute ignored on recursive invokation)
PR optimization/13394
* toplev.c (rest_of_compilation): Move call to
check_function_return_warnings right after the sibcall
optimization pass.
From-SVN: r74961
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/noreturn-7.c | 42 |
2 files changed, 46 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bf06bea..9095c8a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2003-12-23 Eric Botcazou <ebotcazou@libertysurf.fr> + * gcc.dg/noreturn-7.c: New test. + +2003-12-23 Eric Botcazou <ebotcazou@libertysurf.fr> + * gcc.dg/null-pointer-1.c: New test. 2003-12-22 Mark Mitchell <mark@codesourcery.com> diff --git a/gcc/testsuite/gcc.dg/noreturn-7.c b/gcc/testsuite/gcc.dg/noreturn-7.c new file mode 100644 index 0000000..1d94a7c --- /dev/null +++ b/gcc/testsuite/gcc.dg/noreturn-7.c @@ -0,0 +1,42 @@ +/* PR optimization/13394 */ +/* Origin: Carlo Wood <carlo@gcc.gnu.org> */ + +/* Verify that a bogus "function does return" warning is not issued + in presence of tail recursion within a noreturn function. */ + +/* { dg-do compile } */ +/* { dg-options "-O2 -Wreturn-type -Wmissing-noreturn" } */ + + +void f(void) __attribute__ ((__noreturn__)); +void _exit(int status) __attribute__ ((__noreturn__)); + +int z = 0; + +void g() +{ + if (++z > 10) + _exit(0); + g(); +} /* { dg-warning "possible candidate" } */ + +void f() +{ + if (++z > 10) + _exit(0); + f(); +} /* { dg-bogus "does return" } */ + +int h() +{ + if (++z > 10) + _exit(0); + return h(); +} /* { dg-bogus "end of non-void function" } */ + +int k() +{ + if (++z > 10) + _exit(0); + k(); +} /* { dg-warning "end of non-void function" } */ |