From: Jakub Jelinek Date: Wed, 30 Oct 2019 09:52:01 +0000 (+0100) Subject: re PR tree-optimization/92262 (ICE: verify_gimple failed (error: incorrect sharing... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9f33e12137b0216052c230fb653b130828ad575d;p=gcc.git re PR tree-optimization/92262 (ICE: verify_gimple failed (error: incorrect sharing of tree nodes)) PR tree-optimization/92262 * tree-ssa-loop-ivopts.c (get_debug_computation_at): Don't unshare ubase or cbase here. (remove_unused_ivs): Unshare comp before using it. * g++.dg/opt/pr92262.C: New test. From-SVN: r277605 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index db26d1b88c9..821d97a233d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2019-10-30 Jakub Jelinek + + PR tree-optimization/92262 + * tree-ssa-loop-ivopts.c (get_debug_computation_at): Don't unshare + ubase or cbase here. + (remove_unused_ivs): Unshare comp before using it. + 2019-10-30 Jan Hubicka * ipa-prop.c (update_jump_functions_after_inlining): @@ -9459,24 +9466,24 @@ * config/i386/i386-builtins.c (processor_model) : Add M_INTEL_COREI7_TIGERLAKE and M_INTEL_COREI7_COOPERLAKE. (arch_names_table): Add tigerlake and cooperlake. - (get_builtin_code_for_version) : Handle PROCESSOR_TIGERLAKE + (get_builtin_code_for_version): Handle PROCESSOR_TIGERLAKE and PROCESSOR_COOPERLAKE. * config/i386/i386-c.c (ix86_target_macros_internal): Handle tigerlake and cooperlake. * config/i386/i386-options.c - (m_TIGERLAKE) : Define. - (m_COOPERLAKE) : Ditto. + (m_TIGERLAKE): Define. + (m_COOPERLAKE): Ditto. (m_CORE_AVX512): Ditto. (processor_cost_table): Add cascadelake. (ix86_option_override_internal): Hadle PTA_MOVDIRI, PTA_MOVDIR64B. * config/i386/i386.h - (ix86_size_cost) : Define TARGET_TIGERLAKE and TARGET_COOPERLAKE. - (processor_type) : Add PROCESSOR_TIGERLAKE and PROCESSOR_COOPERLAKE. + (ix86_size_cost): Define TARGET_TIGERLAKE and TARGET_COOPERLAKE. + (processor_type): Add PROCESSOR_TIGERLAKE and PROCESSOR_COOPERLAKE. (PTA_MOVDIRI): Ditto. (PTA_MOVDIR64B): Ditto. - (PTA_COOPERLAKE) : Ditto. - (PTA_TIGERLAKE) : Ditto. - (processor_type) : Add PROCESSOR_TIGERLAKE and PROCESSOR_COOPERLAKE. + (PTA_COOPERLAKE): Ditto. + (PTA_TIGERLAKE): Ditto. + (processor_type): Add PROCESSOR_TIGERLAKE and PROCESSOR_COOPERLAKE. * doc/extend.texi: Add tigerlake and cooperlake. * doc/invoke.texi: Add tigerlake and cooperlake. @@ -23009,7 +23016,7 @@ 2019-04-08 wu yuan * config/aarch64/aarch64-cores.def (tsv1100): Change scheduling model. - * config/aarch64/aarch64.md : Add "tsv110.md" + * config/aarch64/aarch64.md: Add "tsv110.md". * config/aarch64/tsv110.md: New file. 2019-04-08 Richard Biener diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 23caef02963..2d1d47ab26b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-10-30 Jakub Jelinek + + PR tree-optimization/92262 + * g++.dg/opt/pr92262.C: New test. + 2019-10-30 Richard Biener PR tree-optimization/65930 @@ -319,8 +324,8 @@ 2019-10-27 Paul Thomas PR fortran/86248 - * gfortran.dg/char_result_19.f90 : New test. - * gfortran.dg/char_result_mod_19.f90 : Module for the new test. + * gfortran.dg/char_result_19.f90: New test. + * gfortran.dg/char_result_mod_19.f90: Module for the new test. 2019-10-26 Hongtao Liu @@ -1424,9 +1429,9 @@ 2019-10-05 Paul Thomas PR fortran/91926 - * gfortran.dg/ISO_Fortran_binding_13.f90 : New test. - * gfortran.dg/ISO_Fortran_binding_13.c : Additional source. - * gfortran.dg/ISO_Fortran_binding_14.f90 : New test. + * gfortran.dg/ISO_Fortran_binding_13.f90: New test. + * gfortran.dg/ISO_Fortran_binding_13.c: Additional source. + * gfortran.dg/ISO_Fortran_binding_14.f90: New test. 2019-10-05 Jakub Jelinek @@ -1815,7 +1820,7 @@ 2019-09-29 Paul Thomas PR fortran/91726 - * gfortran.dg/coarray_poly_9.f90 : New test. + * gfortran.dg/coarray_poly_9.f90: New test. 2019-09-29 Kewen Lin @@ -2047,8 +2052,8 @@ 2019-09-23 Paul Thomas PR fortran/91729 - * gfortran.dg/select_rank_2.f90 : Add two more errors in foo2. - * gfortran.dg/select_rank_3.f90 : New test. + * gfortran.dg/select_rank_2.f90: Add two more errors in foo2. + * gfortran.dg/select_rank_3.f90: New test. 2019-09-23 Rainer Orth @@ -2415,7 +2420,7 @@ 2019-09-17 Paul Thomas PR fortran/91588 - * gfortran.dg/associate_49.f90 : New test. + * gfortran.dg/associate_49.f90: New test. 2019-09-17 Yannick Moy @@ -2544,7 +2549,7 @@ 2019-09-13 Paul Thomas PR fortran/91717 - * gfortran.dg/dependency_55.f90 : New test. + * gfortran.dg/dependency_55.f90: New test. 2019-09-12 Uroš Bizjak @@ -3477,7 +3482,7 @@ 2019-09-02 Paul Thomas PR fortran/91589 - * gfortran.dg/pr91589.f90 : New test. + * gfortran.dg/pr91589.f90: New test. 2019-09-02 Steven G. Kargl @@ -3521,8 +3526,8 @@ 2019-09-01 Paul Thomas - * gfortran.dg/select_rank_1.f90 : New test. - * gfortran.dg/select_rank_2.f90 : New test. + * gfortran.dg/select_rank_1.f90: New test. + * gfortran.dg/select_rank_2.f90: New test. 2019-09-01 Jakub Jelinek @@ -6485,7 +6490,7 @@ 2019-07-07 Paul Thomas PR fortran/91077 - * gfortran.dg/pointer_array_11.f90 : New test. + * gfortran.dg/pointer_array_11.f90: New test. 2019-07-06 Jakub Jelinek @@ -8133,12 +8138,12 @@ 019-06-09 Paul Thomas PR fortran/89365 - * gfortran.dg/assumed_rank_bounds_3.f90 : New test. + * gfortran.dg/assumed_rank_bounds_3.f90: New test. 2019-06-08 Paul Thomas PR fortran/90786 - * gfortran.dg/proc_ptr_51.f90 : New test. + * gfortran.dg/proc_ptr_51.f90: New test. 2019-06-08 Marek Polacek @@ -8873,7 +8878,7 @@ * gcc.target/i386/pr82699-6.c: Likewise. * gcc.target/i386/returninst1.c: Likewise. * gcc.target/i386/returninst2.c: Likewise. - * gcc.target/i386/returninst3.c : Likewise. + * gcc.target/i386/returninst3.c: Likewise. 2019-05-23 Bill Schmidt @@ -9239,7 +9244,7 @@ 2019-05-19 Paul Thomas PR fortran/90498 - * gfortran.dg/associate_48.f90 : New test. + * gfortran.dg/associate_48.f90: New test. 2019-05-19 Thomas Koenig @@ -12799,21 +12804,21 @@ 2019-02-23 Paul Thomas PR fortran/88117 - * gfortran.dg/deferred_character_32.f90 : New test + * gfortran.dg/deferred_character_32.f90: New test. 2019-02-23 Paul Thomas PR fortran/89385 - * gfortran.dg/ISO_Fortran_binding_1.f90 : Correct test for + * gfortran.dg/ISO_Fortran_binding_1.f90: Correct test for previously incorrect lbound for allocatable expressions. Also correct stop values to avoid repetition. - * gfortran.dg/ISO_Fortran_binding_5.f90 : New test - * gfortran.dg/ISO_Fortran_binding_5.c : Support previous test. + * gfortran.dg/ISO_Fortran_binding_5.f90: New test + * gfortran.dg/ISO_Fortran_binding_5.c: Support previous test. PR fortran/89366 - * gfortran.dg/ISO_Fortran_binding_6.f90 : New test - * gfortran.dg/ISO_Fortran_binding_6.c : Support previous test. - * gfortran.dg/pr32599.f03 : Set standard to F2008. + * gfortran.dg/ISO_Fortran_binding_6.f90: New test. + * gfortran.dg/ISO_Fortran_binding_6.c: Support previous test. + * gfortran.dg/pr32599.f03: Set standard to F2008. 2019-02-22 David Malcolm @@ -13453,7 +13458,7 @@ 2019-02-09 Paul Thomas PR fortran/89200 - * gfortran.dg/array_reference_2.f90 : New test. + * gfortran.dg/array_reference_2.f90: New test. 2019-02-09 Jakub Jelinek @@ -13713,17 +13718,17 @@ 2019-02-02 Paul Thomas PR fortran/88393 - * gfortran.dg/alloc_comp_assign_16.f03 : New test. + * gfortran.dg/alloc_comp_assign_16.f03: New test. 2019-02-02 Paul Thomas PR fortran/88980 - * gfortran.dg/realloc_on_assign_32.f90 : New test. + * gfortran.dg/realloc_on_assign_32.f90: New test. 2019-02-02 Paul Thomas PR fortran/88685 - * gfortran.dg/pointer_array_component_3.f90 : New test. + * gfortran.dg/pointer_array_component_3.f90: New test. 2019-02-02 Jakub Jelinek diff --git a/gcc/testsuite/g++.dg/opt/pr92262.C b/gcc/testsuite/g++.dg/opt/pr92262.C new file mode 100644 index 00000000000..3a6478bcf41 --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/pr92262.C @@ -0,0 +1,85 @@ +// PR tree-optimization/92262 +// { dg-do compile { target c++11 } } +// { dg-options "-O2 -ftree-loop-distribution -g" } + +struct A; +struct B { template using b = T *; }; +template using c = B::b; +void *operator new (__SIZE_TYPE__, void *p) { return p; } +struct C { + template void + foo (T *x, U... y) { new (x) T(y...); } +}; +template class D : public C {}; +template struct E; +template struct E> { + using e = D; + template using f = D; + template + static void + bar (e x, U y, V... z) { x.foo (y, z...); } +}; +template struct F : E { + template struct G { typedef typename E::template f O; }; +}; +template void +baz (T x, U y, V z) +{ + F::bar (z, y, *x); +} +struct H { + typedef c I; + typedef c J; + I i; + J j; + void qux (J x) { j = x; } +}; +template +struct K { + K(D x) : k (x) {} + typedef H::J L; + struct M { L m; H n, o; }; + struct N : F>::G::O, M { N (F::G::O); }; + void quux (); + N k; +}; +template +void +K::quux () +{ + L K (k.m - 1); + k.n.qux (K); +} +template +struct P : K { + template + P (T x, T, D y = D ()) : K (y) { corge (x); } + template void corge (T); + typedef L L; +}; +template +template +void P::corge (V y) +{ + quux (); + for (L x = k.n.j; x < k.o.j; ++x) + { + ++y; + D pv; + baz (y, *x, pv); + } + D z; + baz (y, k.o.i, z); +} +struct A { + A (int x) : a (x) {} + int a; +}; +int a[2]{}; + +int +main () +{ + P (a, a); + return 0; +} diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 74a3ac35c87..5938cfec08b 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -4152,8 +4152,6 @@ get_debug_computation_at (class loop *loop, gimple *at, var = fold_convert (ctype, var); } - ubase = unshare_expr (ubase); - cbase = unshare_expr (cbase); if (stmt_after_increment (loop, cand, at)) var = fold_build2 (MINUS_EXPR, TREE_TYPE (var), var, unshare_expr (cstep)); @@ -7648,6 +7646,7 @@ remove_unused_ivs (struct ivopts_data *data, bitmap toremove) if (!best_cand) continue; + comp = unshare_expr (comp); if (count > 1) { tree vexpr = make_node (DEBUG_EXPR_DECL);