diff options
author | Joseph Myers <joseph@codesourcery.com> | 2009-02-19 13:56:00 +0000 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2009-02-19 13:56:00 +0000 |
commit | ab4194daa89047e2eacb66ef8d5d702418905bb0 (patch) | |
tree | 4cadcaa3b993c651af0668a488634c85a19a1b6e /gcc/testsuite/gcc.dg/call-diag-1.c | |
parent | 6b67572ed1a6f2fc43d07eead15e9eda973d339d (diff) | |
download | gcc-ab4194daa89047e2eacb66ef8d5d702418905bb0.zip gcc-ab4194daa89047e2eacb66ef8d5d702418905bb0.tar.gz gcc-ab4194daa89047e2eacb66ef8d5d702418905bb0.tar.bz2 |
re PR c/38483 (generated aborts lose previous side-effects)
PR c/38483
* builtins.c (gimplify_va_arg_expr): Evaluate the va_list
expression before any __builtin_trap call.
* c-typeck.c (build_function_call): Convert and check function
arguments before generating a call to a trap. Evaluate the
function arguments before the trap.
testsuite:
* gcc.c-torture/execute/call-trap-1.c,
gcc.c-torture/execute/va-arg-trap-1.c, gcc.dg/call-diag-1.c: New
tests.
From-SVN: r144296
Diffstat (limited to 'gcc/testsuite/gcc.dg/call-diag-1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/call-diag-1.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/call-diag-1.c b/gcc/testsuite/gcc.dg/call-diag-1.c new file mode 100644 index 0000000..884baa0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/call-diag-1.c @@ -0,0 +1,9 @@ +/* The warning for calling through a non-compatible type must not + disable the normal diagnostics from comparing the argument list + against the type of the called expression. */ +/* Origin: Joseph Myers <joseph@codesourcery.com> */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +void foo (void); +void bar (void) { ((long (*)(int))foo) (); } /* { dg-error "too few arguments to function" } */ |