https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103234
Bug ID: 103234 Summary: ipa-sra is broken (and therefore disabled) on variably sized parameters Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: hubicka at gcc dot gnu.org CC: marxin at gcc dot gnu.org Target Milestone: --- Disabling workaround I needed to add to ipa-fnsummary: for (tree parm = DECL_ARGUMENTS (node->decl); parm && !no_signature; parm = DECL_CHAIN (parm)) if (variably_modified_type_p (TREE_TYPE (parm), node->decl)) { if (dump_file) { fprintf (dump_file, "No signature change:" " has parameter with variably modified type.\n"); } no_signature = true; } we end up with few ICES in gfortran testsuite: ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.dg/associate_35.f90 -O2 (internal compiler error) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.dg/associate_35.f90 -O2 (test for excess errors) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.dg/associate_35.f90 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (internal compiler error) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.dg/associate_35.f90 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.dg/associate_35.f90 -O3 -g (internal compiler error) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.dg/associate_35.f90 -O3 -g (test for excess errors) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.dg/associate_35.f90 -Os (internal compiler error) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.dg/associate_35.f90 -Os (test for excess errors) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.dg/associated_assumed_rank.f90 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (internal compiler error) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.dg/associated_assumed_rank.f90 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.dg/associated_assumed_rank.f90 -O3 -g (internal compiler error) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.dg/associated_assumed_rank.f90 -O3 -g (test for excess errors) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.dg/trim_optimize_4.f90 -O2 (internal compiler error) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.dg/trim_optimize_4.f90 -O2 (test for excess errors) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.dg/trim_optimize_4.f90 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (internal compiler error) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.dg/trim_optimize_4.f90 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.dg/trim_optimize_4.f90 -O3 -g (internal compiler error) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.dg/trim_optimize_4.f90 -O3 -g (test for excess errors) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.dg/trim_optimize_4.f90 -Os (internal compiler error) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.dg/trim_optimize_4.f90 -Os (test for excess errors) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.fortran-torture/execute/entry_2.f90, -O2 (internal compiler error) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.fortran-torture/execute/entry_2.f90, -O2 -fomit-frame-pointer -finline-functions (internal compiler error) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.fortran-torture/execute/entry_2.f90, -O2 -fomit-frame-pointer -finline-functions -funroll-loops (internal compiler error) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.fortran-torture/execute/entry_2.f90, -O3 -g (internal compiler error) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.fortran-torture/execute/entry_2.f90, -Os (internal compiler error) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.fortran-torture/execute/entry_2.f90, -O2 -ftree-vectorize -msse2 (internal compiler error) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.fortran-torture/execute/entry_5.f90, -O2 (internal compiler error) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.fortran-torture/execute/entry_5.f90, -O2 -fomit-frame-pointer -finline-functions (internal compiler error) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.fortran-torture/execute/entry_5.f90, -O2 -fomit-frame-pointer -finline-functions -funroll-loops (internal compiler error) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.fortran-torture/execute/entry_5.f90, -O3 -g (internal compiler error) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.fortran-torture/execute/entry_5.f90, -Os (internal compiler error) ./testsuite/gfortran/gfortran.sum:FAIL: gfortran.fortran-torture/execute/entry_5.f90, -O2 -ftree-vectorize -msse2 (internal compiler error) There is check in ipa-param-manipulation testing that removed parameter is not having assigned parm decl by inliner which fails because we push decls of variable size and the size is specified by parameter we decided to optimize out. I think in this case we can replace it by error_mark_node since they use should not matter?