diff options
author | Richard Guenther <rguenther@suse.de> | 2009-07-17 15:49:34 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2009-07-17 15:49:34 +0000 |
commit | a406865a0845cdef8bdd3eefa53e7f3992cb34ff (patch) | |
tree | 9b2cab79aaf97c242bb77cbc530d76b88b5a1734 /gcc/testsuite | |
parent | e7d5b5b9c426b3b2f64c49d8a0eac9ab9d3b0c57 (diff) | |
download | gcc-a406865a0845cdef8bdd3eefa53e7f3992cb34ff.zip gcc-a406865a0845cdef8bdd3eefa53e7f3992cb34ff.tar.gz gcc-a406865a0845cdef8bdd3eefa53e7f3992cb34ff.tar.bz2 |
re PR c/40401 (ICE: verify_gimple failed)
2009-07-17 Richard Guenther <rguenther@suse.de>
PR c/40401
* tree-pass.h (pass_diagnose_omp_blocks): Declare.
(pass_warn_unused_result): Likewise.
(TODO_set_props): Remove.
* omp-low.c (diagnose_omp_structured_block_errors): Change to
run as a pass.
(pass_diagnose_omp_blocks): Define.
* c-decl.c (pop_file_scope): Do not finalize the CU here.
(c_gimple_diagnostics_recursively): Remove.
(finish_function): Do not call it.
(c_write_global_declarations): Continue after errors.
Finalize the CU here.
* c-gimplify.c (c_genericize): Do not gimplify here.
* c-common.c (c_warn_unused_result): Move ...
* tree-cfg.c (do_warn_unused_result): ... here.
(run_warn_unused_result): New function.
(gate_warn_unused_result): New function.
(pass_warn_unused_result): New pass.
* c-common.h (c_warn_unused_result): Remove.
* flags.h (flag_warn_unused_result): Declare.
* c-opts.c (c_common_init_options): Enable flag_warn_unused_result.
* opts.c (flag_warn_unused_result): Initialize to false.
* toplev.c (compile_file): Add comment.
* omp-low.c (create_omp_child_function): Do not register
the function with the frontend.
(diagnose_omp_structured_block_errors): Prepare to be
called as optimization pass.
(gate_diagnose_omp_blocks): New function.
(pass_diagnose_omp_blocks): New pass.
* cgraph.h (cgraph_optimize): Remove.
(cgraph_analyze_function): Likewise.
* cgraph.c (cgraph_add_new_function): Gimplify C++ thunks.
* cgraphunit.c (cgraph_lower_function): Lower nested functions
before their parents here.
(cgraph_finalize_function): Not here.
(cgraph_analyze_function): Gimplify functions here.
(cgraph_finalize_compilation_unit): Continue after errors.
Optimize the callgraph from here.
(cgraph_optimize): Make static.
* langhooks.c (write_global_declarations): Finalize the CU.
* gimplify.c (gimplify_asm_expr): Do not emit ASMs with errors.
(gimplify_function_tree): Assert we gimplify only once.
Set PROP_gimple_any property.
* tree-nested.c (gimplify_all_functions): New function.
(lower_nested_functions): Gimplify all nested functions.
* gimple.h (diagnose_omp_structured_block_errors): Remove.
* passes.c (init_optimization_passes): Add pass_warn_unused_result
and pass_diagnose_omp_blocks after gimplification. Do not
set TODO_set_props on all_lowering_passes.
(execute_one_pass): Do not handle TODO_set_props.
* Makefile.in (cgraphunit.o): Add $(TREE_DUMP_H) dependency.
(gimplify.o): Add tree-pass.h dependency.
* tree-inline.c (copy_statement_list): Properly copy STATEMENT_LIST.
(copy_tree_body_r): Properly handle TARGET_EXPR like SAVE_EXPR.
(unsave_r): Likewise.
* c-omp.c (c_finish_omp_atomic): Set DECL_CONTEXT on the
temporary variable.
cp/
* decl.c (finish_function): Do not emit unused result warnings
from here.
* cp-objcp-common.h (LANG_HOOKS_POST_GIMPLIFY_PASS): Use
c_warn_unused_result_pass.
* semantics.c (expand_or_defer_fn): Adjust assertion about IL status.
* optimize.c (clone_body): Clone in GENERIC.
(maybe_clone_body): Do not clear DECL_SAVED_TREE.
* decl2.c (cp_write_global_declarations): Fix body test.
Do not call cgraph_optimize.
* Make-lang.in (optimize.o): Add tree-iterator.h dependency.
* method.c (use_thunk): Register thunk with
cgraph_finalize_function.
* error.c (function_category): Guard access of DECL_LANG_SPECIFIC.
java/
* java-gimplify.c (java_genericize): Do not gimplify here.
But replace all local references.
(java_gimplify_expr): Do not replace local references here.
(java_gimplify_modify_expr): Likewise.
* jcf-parse.c (java_parse_file): Do not finalize the CU or
optimize the cgraph here.
* decl.c (java_replace_reference): Make static.
(java_replace_references): New function.
(end_java_method): Clear base_decl_map.
* java-tree.h (java_replace_references): Declare.
(java_replace_reference): Remove.
ada/
* utils.c (end_subprog_body): Revert to pre-tuples state. Remove
unused parameter.
(gnat_gimplify_function): Do not gimplify here.
Fold into its only caller and remove.
(gnat_builtin_function): Adjust for end_subprog_body signature change.
(gnat_write_global_declarations): Also finalize the CU.
* misc.c (gnat_parse_file): Do not finalize the CU here.
* trans.c (gigi): Revert to pre-tuples state.
(Subprogram_Body_to_gnu): Adjust for end_subprog_body signature
change.
* gigi.h (end_subprog_body): Remove unused parameter.
fortran/
* f95-lang.c (gfc_be_parse_file): Do not finalize the CU here.
* trans-decl.c (gfc_gimplify_function): Remove.
(build_entry_thunks): Do not gimplify here.
(create_main_function): Likewise.
(gfc_generate_function_code): Likewise.
* g++.dg/rtti/crash4.C: New testcase.
* g++.dg/torture/20090706-1.C: Likewise.
* gcc.dg/redecl-17.c: Likewise.
* gfortran.dg/missing_optional_dummy_5.f90: Adjust pattern.
* gcc.dg/declspec-9.c: Expect extra error.
* gcc.dg/declspec-10.c: Likewise.
* gcc.dg/declspec-11.c: Likewise.
* gcc.dg/redecl-10.c: Expect extra warnings.
* gcc.target/i386/pr39082-1.c: Adjust diagnostic location.
* gcc.target/i386/pr39545-1.c: Likewise.
* g++.dg/ext/asm3.C: Expect more errors.
* g++.dg/gomp/block-1.C: Likewise.
* g++.dg/gomp/block-2.C: Likewise.
* g++.dg/gomp/block-3.C: Likewise.
* g++.dg/gomp/block-5.C: Likewise.
* g++.old-deja/g++.jason/report.C: Expect extra warnings.
* g++.dg/warn/unused-result1.C: XFAIL.
From-SVN: r149750
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 21 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/asm3.C | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/gomp/block-1.C | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/gomp/block-2.C | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/gomp/block-3.C | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/gomp/block-5.C | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/rtti/crash4.C | 16 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/torture/20090706-1.C | 41 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/warn/unused-result1.C | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.jason/report.C | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/declspec-10.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/declspec-11.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/declspec-9.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/redecl-10.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/redecl-17.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr39082-1.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr39545-1.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/missing_optional_dummy_5.f90 | 2 |
18 files changed, 119 insertions, 10 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d35fe72..3b704d5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,26 @@ 2009-07-17 Richard Guenther <rguenther@suse.de> + PR c/40401 + * g++.dg/rtti/crash4.C: New testcase. + * g++.dg/torture/20090706-1.C: Likewise. + * gcc.dg/redecl-17.c: Likewise. + * gfortran.dg/missing_optional_dummy_5.f90: Adjust pattern. + * gcc.dg/declspec-9.c: Expect extra error. + * gcc.dg/declspec-10.c: Likewise. + * gcc.dg/declspec-11.c: Likewise. + * gcc.dg/redecl-10.c: Expect extra warnings. + * gcc.target/i386/pr39082-1.c: Adjust diagnostic location. + * gcc.target/i386/pr39545-1.c: Likewise. + * g++.dg/ext/asm3.C: Expect more errors. + * g++.dg/gomp/block-1.C: Likewise. + * g++.dg/gomp/block-2.C: Likewise. + * g++.dg/gomp/block-3.C: Likewise. + * g++.dg/gomp/block-5.C: Likewise. + * g++.old-deja/g++.jason/report.C: Expect extra warnings. + * g++.dg/warn/unused-result1.C: XFAIL. + +2009-07-17 Richard Guenther <rguenther@suse.de> + PR tree-optimization/40321 * gcc.c-torture/compile/pr40321.c: New testcase. * g++.dg/torture/pr40321.C: Likewise. diff --git a/gcc/testsuite/g++.dg/ext/asm3.C b/gcc/testsuite/g++.dg/ext/asm3.C index 5eff16f..090218f 100644 --- a/gcc/testsuite/g++.dg/ext/asm3.C +++ b/gcc/testsuite/g++.dg/ext/asm3.C @@ -8,6 +8,8 @@ int two(int in) { register int out; - __asm__ ("" : "r" (out) : "r" (in)); // { dg-error "" "" } + __asm__ ("" : "r" (out) : "r" (in)); return out; } + +// { dg-message "error:" "" { target *-*-* } 11 } diff --git a/gcc/testsuite/g++.dg/gomp/block-1.C b/gcc/testsuite/g++.dg/gomp/block-1.C index 50a8c0e..d2b8664 100644 --- a/gcc/testsuite/g++.dg/gomp/block-1.C +++ b/gcc/testsuite/g++.dg/gomp/block-1.C @@ -20,3 +20,6 @@ void foo() { ok1: break; } } } + +// { dg-message "error: invalid branch to/from an OpenMP structured block" "" { target *-*-* } 7 } +// { dg-message "error: invalid entry to OpenMP structured block" "" { target *-*-* } 9 } diff --git a/gcc/testsuite/g++.dg/gomp/block-2.C b/gcc/testsuite/g++.dg/gomp/block-2.C index 621a90d..17d98d8 100644 --- a/gcc/testsuite/g++.dg/gomp/block-2.C +++ b/gcc/testsuite/g++.dg/gomp/block-2.C @@ -30,3 +30,6 @@ void foo() for (i = 0; i < 10; ++i) continue; } + +// { dg-message "error: invalid branch to/from an OpenMP structured block" "" { target *-*-* } 14 } +// { dg-message "error: invalid entry to OpenMP structured block" "" { target *-*-* } 16 } diff --git a/gcc/testsuite/g++.dg/gomp/block-3.C b/gcc/testsuite/g++.dg/gomp/block-3.C index 8e036e4..aeb0c77 100644 --- a/gcc/testsuite/g++.dg/gomp/block-3.C +++ b/gcc/testsuite/g++.dg/gomp/block-3.C @@ -55,3 +55,7 @@ void foo() } } } + +// { dg-message "error: invalid branch to/from an OpenMP structured block" "" { target *-*-* } 21 } +// { dg-message "error: invalid branch to/from an OpenMP structured block" "" { target *-*-* } 26 } +// { dg-message "error: invalid entry to OpenMP structured block" "" { target *-*-* } 30 } diff --git a/gcc/testsuite/g++.dg/gomp/block-5.C b/gcc/testsuite/g++.dg/gomp/block-5.C index 67ed72c..391f8b6 100644 --- a/gcc/testsuite/g++.dg/gomp/block-5.C +++ b/gcc/testsuite/g++.dg/gomp/block-5.C @@ -13,3 +13,5 @@ void foo() return; // { dg-error "invalid exit" } } } + +// { dg-message "error: invalid branch to/from an OpenMP structured block" "" { target *-*-* } 7 } diff --git a/gcc/testsuite/g++.dg/rtti/crash4.C b/gcc/testsuite/g++.dg/rtti/crash4.C new file mode 100644 index 0000000..49807e9 --- /dev/null +++ b/gcc/testsuite/g++.dg/rtti/crash4.C @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-O" } */ + +class ios_base { +public: + virtual ~ios_base(); +}; +template<typename _CharT> +class basic_ostream : virtual public ios_base { +public: + virtual ~basic_ostream() { } +}; +extern template class basic_ostream<char>; +template <typename _CharT> +class basic_ostringstream : public basic_ostream<_CharT> { }; +template class basic_ostringstream<char>; diff --git a/gcc/testsuite/g++.dg/torture/20090706-1.C b/gcc/testsuite/g++.dg/torture/20090706-1.C new file mode 100644 index 0000000..43a59f0 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/20090706-1.C @@ -0,0 +1,41 @@ +/* { dg-do compile } */ + +namespace std __attribute__ ((__visibility__ ("default"))) { + template<typename _Tp> class new_allocator { }; + template<typename _Tp> class allocator: public new_allocator<_Tp> { }; + template<typename _Tp, typename _Alloc> struct _Vector_base { }; + template<typename _Tp, typename _Alloc = std::allocator<_Tp> > + class vector : protected _Vector_base<_Tp, _Alloc> { }; +}; +template<int Dim> class Vector { }; +enum CenteringType { VertexType, EdgeType, FaceType, CellType }; +enum ContinuityType { XDim = 1, YDim = XDim << 1, ZDim = YDim << 1 }; +template <int Dim> class Centering { +public: + typedef Vector<Dim> Position; + typedef std::vector<Position> Positions; + Centering(const Positions &positions); + Positions positions_m; +}; +template <int Dim> class CanonicalCentering { + CanonicalCentering(); + template <class T> static T combine(const T &op1, const T &op2); + static Centering<Dim>*** centering_table_m; +}; +template <int Dim> CanonicalCentering<Dim>::CanonicalCentering() +{ + typename Centering<Dim>::Positions positions[Dim][2]; + enum { x = 0, y, z }; + int cont = 0; + if (Dim > 1) + { + centering_table_m[EdgeType][cont][YDim] = Centering<Dim>(positions[y][cont]); + centering_table_m[EdgeType][cont][XDim|YDim] = Centering<Dim>(combine(positions[x][cont], positions[y][cont])); + } + if (Dim > 2) + { + centering_table_m[EdgeType][cont][ZDim] = Centering<Dim>(positions[z][cont]); + centering_table_m[EdgeType][cont][XDim|ZDim] = Centering<Dim>(combine(positions[x][cont], positions[z][cont])); + } +} +template class CanonicalCentering<2>; diff --git a/gcc/testsuite/g++.dg/warn/unused-result1.C b/gcc/testsuite/g++.dg/warn/unused-result1.C index 1b9ef8a..466c99e 100644 --- a/gcc/testsuite/g++.dg/warn/unused-result1.C +++ b/gcc/testsuite/g++.dg/warn/unused-result1.C @@ -6,5 +6,5 @@ public: }; class QString { QByteArray toLocal8Bit() const __attribute__ ((warn_unused_result)); - void fooWarnHere() const { toLocal8Bit(); } // { dg-warning "ignoring" } + void fooWarnHere() const { toLocal8Bit(); } // { dg-warning "ignoring" "" { xfail *-*-* } } }; diff --git a/gcc/testsuite/g++.old-deja/g++.jason/report.C b/gcc/testsuite/g++.old-deja/g++.jason/report.C index e1079cf..b595662 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/report.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/report.C @@ -72,3 +72,6 @@ int darg (char X::*p) { undef3 (1); // { dg-error "" } implicit declaration } // { dg-warning "no return statement" } + +// { dg-message "warning: control reaches end of non-void function" "" { target *-*-* } 36 } +// { dg-message "warning: control reaches end of non-void function" "" { target *-*-* } 65 } diff --git a/gcc/testsuite/gcc.dg/declspec-10.c b/gcc/testsuite/gcc.dg/declspec-10.c index f938bf1..ddc6064 100644 --- a/gcc/testsuite/gcc.dg/declspec-10.c +++ b/gcc/testsuite/gcc.dg/declspec-10.c @@ -43,3 +43,5 @@ void i (void) { auto void y (void) {} } /* { dg-warning "ISO C forbids nested fu /* { dg-warning "function definition declared 'auto'" "nested" { target *-*-* } 42 } */ inline int main (void) { return 0; } /* { dg-warning "cannot inline function 'main'" } */ + +/* { dg-message "error: register name not specified for 'y'" "" { target *-*-* } 19 } */ diff --git a/gcc/testsuite/gcc.dg/declspec-11.c b/gcc/testsuite/gcc.dg/declspec-11.c index c3fec46..9dfe63f 100644 --- a/gcc/testsuite/gcc.dg/declspec-11.c +++ b/gcc/testsuite/gcc.dg/declspec-11.c @@ -43,3 +43,5 @@ void i (void) { auto void y (void) {} } /* { dg-error "ISO C forbids nested func /* { dg-error "function definition declared 'auto'" "nested" { target *-*-* } 42 } */ inline int main (void) { return 0; } /* { dg-error "cannot inline function 'main'" } */ + +/* { dg-message "error: register name not specified for 'y'" "" { target *-*-* } 19 } */ diff --git a/gcc/testsuite/gcc.dg/declspec-9.c b/gcc/testsuite/gcc.dg/declspec-9.c index ece47c6..7766ed6 100644 --- a/gcc/testsuite/gcc.dg/declspec-9.c +++ b/gcc/testsuite/gcc.dg/declspec-9.c @@ -17,7 +17,7 @@ void f6 (static int); /* { dg-error "storage class specified for unnamed paramet void f7 (typedef int); /* { dg-error "storage class specified for unnamed parameter" } */ auto int x; /* { dg-error "file-scope declaration of 'x' specifies 'auto'" } */ -register int y; +register int y; /* { dg-error "register name not specified for 'y'" } */ void h (void) { extern void x (void) {} } /* { dg-error "nested function 'x' declared 'extern'" } */ diff --git a/gcc/testsuite/gcc.dg/redecl-10.c b/gcc/testsuite/gcc.dg/redecl-10.c index 88d804e..525961e 100644 --- a/gcc/testsuite/gcc.dg/redecl-10.c +++ b/gcc/testsuite/gcc.dg/redecl-10.c @@ -12,7 +12,7 @@ f (void) extern int w[] = { 1, 2 }; /* { dg-error "has both" } */ } -int x[]; +int x[]; /* { dg-warning "array 'x' assumed to have one element" } */ void g (void) { @@ -26,7 +26,7 @@ h (void) extern int y[] = { 6 }; /* { dg-error "has both" } */ } -int z[]; +int z[]; /* { dg-warning "array 'z' assumed to have one element" } */ void i (void) { diff --git a/gcc/testsuite/gcc.dg/redecl-17.c b/gcc/testsuite/gcc.dg/redecl-17.c new file mode 100644 index 0000000..686ebc5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/redecl-17.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ + +void (*fp)(const int i); +void (*fp)(int i); + +void foo() +{ + (*fp)(0); +} + diff --git a/gcc/testsuite/gcc.target/i386/pr39082-1.c b/gcc/testsuite/gcc.target/i386/pr39082-1.c index 4c4e254..81b5bb6 100644 --- a/gcc/testsuite/gcc.target/i386/pr39082-1.c +++ b/gcc/testsuite/gcc.target/i386/pr39082-1.c @@ -13,7 +13,7 @@ extern int bar1 (union un); extern union un bar2 (int); int -foo1 (union un u) /* { dg-message "note: The ABI of passing union with long double has changed in GCC 4.4" } */ +foo1 (union un u) { bar1 (u); return u.i; @@ -30,6 +30,6 @@ foo2 (void) int foo3 (int x) { - union un u = bar2 (x); + union un u = bar2 (x); /* { dg-message "note: The ABI of passing union with long double has changed in GCC 4.4" } */ return u.i; } diff --git a/gcc/testsuite/gcc.target/i386/pr39545-1.c b/gcc/testsuite/gcc.target/i386/pr39545-1.c index 62bc33f..281c8cb 100644 --- a/gcc/testsuite/gcc.target/i386/pr39545-1.c +++ b/gcc/testsuite/gcc.target/i386/pr39545-1.c @@ -10,14 +10,14 @@ struct flex }; int -foo (struct flex s) /* { dg-message "note: The ABI of passing struct with a flexible array member has changed in GCC 4.4" } */ +foo (struct flex s) { return s.i; } struct flex bar (int x) -{ +{ /* { dg-message "note: The ABI of passing struct with a flexible array member has changed in GCC 4.4" } */ struct flex s; s.i = x; return s; diff --git a/gcc/testsuite/gfortran.dg/missing_optional_dummy_5.f90 b/gcc/testsuite/gfortran.dg/missing_optional_dummy_5.f90 index 4ad399e..29a9d70 100644 --- a/gcc/testsuite/gfortran.dg/missing_optional_dummy_5.f90 +++ b/gcc/testsuite/gfortran.dg/missing_optional_dummy_5.f90 @@ -23,7 +23,7 @@ contains end function tm_doit end module krmod -! { dg-final { scan-tree-dump " tm_doit \\(&parm.\(6|7\), 0B, 0\\);" "original" } } +! { dg-final { scan-tree-dump " tm_doit \\(&parm\.., 0B, 0\\);" "original" } } ! { dg-final { cleanup-tree-dump "original" } } ! { dg-final { cleanup-modules "krmod" } } |