From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B99DB3858CDB; Mon, 15 Aug 2022 07:22:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B99DB3858CDB From: "slyfox at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/106617] [13 Regression] gcc is very slow at ternary expressions, Date: Mon, 15 Aug 2022 07:22:26 +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: 13.0 X-Bugzilla-Keywords: compile-time-hog X-Bugzilla-Severity: normal X-Bugzilla-Who: slyfox at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Aug 2022 07:22:26 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106617 --- Comment #6 from Sergei Trofimovich --- Created attachment 53455 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D53455&action=3Dedit ring_buffer.c.gz ring_buffer.c.gz is a preprocessed file from linux-4.19. $ time gcc-12.1.0 -O2 -c ring_buffer.c -o bug.o real 0m0,308s user 0m0,285s sys 0m0,017s $ gcc -O2 -c ring_buffer.c -o bug.o # Runs for minutes, increases RAM usage, never finishes. perf stats after 3 minutes' run: 10,16% cc1 [.] operand_compare::operand_equal_p 7,38% cc1 [.] fold_binary_loc 7,01% cc1 [.] generic_simplify_453 5,63% cc1 [.] generic_simplify_GT_EXPR 3,72% cc1 [.] wide_int_binop 3,42% cc1 [.] generic_simplify_COND_EXPR 3,38% cc1 [.] hash_table::find_slot_with_hash 3,04% cc1 [.] wide_int_to_tree_1 3,00% cc1 [.] tree_strip_nop_conversions 2,82% cc1 [.] int_const_binop 2,47% cc1 [.] get_inner_reference 2,45% cc1 [.] fold_build2_loc 2,23% cc1 [.] fold_ternary_loc 2,07% cc1 [.] tree_strip_sign_nop_conversions 1,96% cc1 [.] int_cst_hasher::hash 1,83% cc1 [.] ggc_internal_alloc 1,81% cc1 [.] fold_relational_const 1,61% cc1 [.] wi::fits_to_tree_p > > > 1,57% cc1 [.] generic_simplify_155 1,51% cc1 [.] operand_equal_p 1,22% cc1 [.] dbg_cnt 1,20% cc1 [.] element_precision 1,10% cc1 [.] ggc_free=