From: Richard Biener Date: Fri, 29 Jan 2021 15:02:36 +0000 (+0100) Subject: rtl-optimization/98863 - tame i386 specific RPAD pass X-Git-Tag: releases/gcc-10.3.0~323 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=550bf0c50024c320b7010d1b2bf644c5c918ad98;p=thirdparty%2Fgcc.git rtl-optimization/98863 - tame i386 specific RPAD pass This removes analyzing DF with expensive problems which we do not use at all and which somehow cause 5GB of memory to leak. Instead just do a defered rescan of added insns. This avoids > FAIL: gcc.c-torture/compile/20051216-1.c -O1 (internal compiler error) > FAIL: gcc.c-torture/compile/20051216-1.c -O1 (test for excess errors) by clearing DF_DEFER_INSN_RESCAN after calling df_process_deferred_rescans, so that it doesn't leak into following unprepared passes that expect non-deferred rescans. 2021-02-03 Richard Biener Jakub Jelinek PR rtl-optimization/98863 * config/i386/i386-features.c (remove_partial_avx_dependency): Do not perform DF analysis. (pass_data_remove_partial_avx_dependency): Remove TODO_df_finish. * gcc.target/i386/20051216-1.c: New test. --- diff --git a/gcc/config/i386/i386-features.c b/gcc/config/i386/i386-features.c index b1109de7cb61..ecc8c014aca3 100644 --- a/gcc/config/i386/i386-features.c +++ b/gcc/config/i386/i386-features.c @@ -2143,6 +2143,9 @@ remove_partial_avx_dependency (void) auto_vec control_flow_insns; + /* We create invalid RTL initially so defer rescans. */ + df_set_flags (DF_DEFER_INSN_RESCAN); + FOR_EACH_BB_FN (bb, cfun) { FOR_BB_INSNS (bb, insn) @@ -2159,14 +2162,7 @@ remove_partial_avx_dependency (void) continue; if (!v4sf_const0) - { - calculate_dominance_info (CDI_DOMINATORS); - df_set_flags (DF_DEFER_INSN_RESCAN); - df_chain_add_problem (DF_DU_CHAIN | DF_UD_CHAIN); - df_md_add_problem (); - df_analyze (); - v4sf_const0 = gen_reg_rtx (V4SFmode); - } + v4sf_const0 = gen_reg_rtx (V4SFmode); /* Convert PARTIAL_XMM_UPDATE_TRUE insns, DF -> SF, SF -> DF, SI -> SF, SI -> DF, DI -> SF, DI -> DF, to vec_dup and @@ -2227,6 +2223,7 @@ remove_partial_avx_dependency (void) { /* (Re-)discover loops so that bb->loop_father can be used in the analysis below. */ + calculate_dominance_info (CDI_DOMINATORS); loop_optimizer_init (AVOID_CFG_MODIFICATIONS); /* Generate a vxorps at entry of the nearest dominator for basic @@ -2258,7 +2255,6 @@ remove_partial_avx_dependency (void) set_insn = emit_insn_after (set, insn ? PREV_INSN (insn) : BB_END (bb)); df_insn_rescan (set_insn); - df_process_deferred_rescans (); loop_optimizer_finalize (); if (!control_flow_insns.is_empty ()) @@ -2279,6 +2275,8 @@ remove_partial_avx_dependency (void) } } + df_process_deferred_rescans (); + df_clear_flags (DF_DEFER_INSN_RESCAN); bitmap_obstack_release (NULL); BITMAP_FREE (convert_bbs); @@ -2298,7 +2296,7 @@ const pass_data pass_data_remove_partial_avx_dependency = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_df_finish, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_remove_partial_avx_dependency : public rtl_opt_pass diff --git a/gcc/testsuite/gcc.target/i386/20051216-1.c b/gcc/testsuite/gcc.target/i386/20051216-1.c new file mode 100644 index 000000000000..42a31d0936e5 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/20051216-1.c @@ -0,0 +1,5 @@ +/* PR rtl-optimization/25432 */ +/* { dg-do compile } */ +/* { dg-options "-O1 -march=cascadelake" } */ + +#include "../../gcc.c-torture/compile/20051216-1.c"