From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D21733857B9B; Thu, 2 Feb 2023 14:01:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D21733857B9B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675346477; bh=n4XqIKcmkLVZ2oXLmmQDWpsMEGvcVdUaITfbR+oF0N4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oAgaDN4HgSRC9ZRKManHv2vJ23Uie+YzzFvHAqRm9G1rjh2jnlPpIB49qJI+1JOPl +TZF63V1JophOt9WD8S14se/9orWXLsldSDquB5hDLyFlbrOBaKqkgjxaeWFZZIdwu 31kNTZ6YYOzhvDaqOK96yuAarfu44+muFDsBNVdc= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108500] [11/12 Regression] -O -finline-small-functions results in "internal compiler error: Segmentation fault" on a very large program (700k function calls) Date: Thu, 02 Feb 2023 14:01:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: compile-time-hog, ice-on-valid-code, memory-hog X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108500 --- Comment #16 from Richard Biener --- (In reply to Richard Biener from comment #14) > Martin, can you look at the SRA issue? Do you want me to create a separa= te > bugreport for this? The IL into SRA looks like >=20 > : > s2D.2755 =3D {}; > s1D.2756 =3D {}; > _unusedD.2002766 =3D s1D.2756; > sD.2002767 =3D s2D.2755; > s2D.2755 =3D sD.2002767; > _unusedD.2002766 =3D{v} {CLOBBER(eol)}; > sD.2002767 =3D{v} {CLOBBER(eol)}; > _unusedD.2002764 =3D s1D.2756; > sD.2002765 =3D s2D.2755; > s2D.2755 =3D sD.2002765; > _unusedD.2002764 =3D{v} {CLOBBER(eol)}; > sD.2002765 =3D{v} {CLOBBER(eol)}; > _unusedD.2002762 =3D s1D.2756; > sD.2002763 =3D s2D.2755; > s2D.2755 =3D sD.2002763; > _unusedD.2002762 =3D{v} {CLOBBER(eol)}; > sD.2002763 =3D{v} {CLOBBER(eol)}; > _unusedD.2002760 =3D s1D.2756; > sD.2002761 =3D s2D.2755; > s2D.2755 =3D sD.2002761; > _unusedD.2002760 =3D{v} {CLOBBER(eol)}; > sD.2002761 =3D{v} {CLOBBER(eol)}; > ... struct s1 { char a[20] ; char b[20] ; }; struct s2 { int id; char a[20]; }; static inline __attribute__((always_inline)) struct s2 f(struct s1 _unused, struct s2 s) {=20 return s; }=20 volatile struct s2 x; int main(void) { struct s2 s2 =3D {0}; struct s1 s1 =3D {0}; #define TEN \ s2 =3D f(s1,s2); \ s2 =3D f(s1,s2); \ s2 =3D f(s1,s2); \ s2 =3D f(s1,s2); \ s2 =3D f(s1,s2); \ s2 =3D f(s1,s2); \ s2 =3D f(s1,s2); \ s2 =3D f(s1,s2); \ s2 =3D f(s1,s2); \ s2 =3D f(s1,s2); TEN TEN x =3D s2; return 0; } shows this. With diff --git a/gcc/tree-sra.cc b/gcc/tree-sra.cc index ad0c738645d..ab3f47badcb 100644 --- a/gcc/tree-sra.cc +++ b/gcc/tree-sra.cc @@ -2980,6 +2980,7 @@ propagate_subaccesses_from_lhs (struct access *lacc, struct access *racc) static void propagate_all_subaccesses (void) { + unsigned cnt =3D 0; propagation_budget =3D new hash_map; while (rhs_work_queue_head) { @@ -2994,6 +2995,7 @@ propagate_all_subaccesses (void) { struct access *lacc =3D link->lacc; + cnt++; if (!bitmap_bit_p (candidate_bitmap, DECL_UID (lacc->base))) continue; lacc =3D lacc->group_representative; @@ -3019,6 +3021,7 @@ propagate_all_subaccesses (void) while (lacc); } } + fprintf (stderr, "%d\n", cnt); while (lhs_work_queue_head) { we have with one TEN > ./cc1 -quiet t.c -O 0 220 120 and with two TEN > ./cc1 -quiet t.c -O 0 840 440 and with four TEN > ./cc1 -quiet t.c -O 0 3280 1680 that's quadratic and has a quite high linear factor as well.=