From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by server2.sourceware.org (Postfix, from userid 48) id 80356385E828; Mon, 9 Mar 2020 06:06:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 server2.sourceware.org 80356385E828 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1583733986; bh=H8DaWq8IaFvq+NLUxGopweSlKyHosXB2vVlhgs4M7xw=; h=From:To:Subject:Date:From; b=WXpU6SPVgxfD3BrLfoR7iMogd86bsOsJzH5NyXaecsdaHoIwZpmGoOEjgBCRNhm/t dzj5nUcwDFQKWcDE+cqSF/nLcmlTXYI8YFid4EMVxzYGUItiTc7OwnPfli0bsx+MIe gUkcnp55zn7Bl+V46aYNSCIegSuMK6nBugJ653iY= From: "bina2374 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/94092] New: Code size and performance degradations after -ftree-loop-distribute-patterns was enabled at -O[2s]+ Date: Mon, 09 Mar 2020 06:06:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: bina2374 at gmail dot com 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone cf_gcctarget Message-ID: 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, 09 Mar 2020 06:06:26 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94092 Bug ID: 94092 Summary: Code size and performance degradations after -ftree-loop-distribute-patterns was enabled at -O[2s]+ Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: bina2374 at gmail dot com Target Milestone: --- Target: riscv64-unknown-elf Since https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D88440, loop-distribute-patterns was enabled at -O[2s]+. We understand that this pa= tch is helpful in some cases, but not for all. In the original bugzilla, the loop count is known, and the performance and = code size are all improved finally. However, if loop count is unknown, the resul= ts may become worse. void init_array(int N, int *array) { int i; for (i =3D 0; i < N; i++) array[i] =3D 0; } init_array: mv a2,a0 mv a0,a1 ble a2,zero,.L1 slli a2,a2,2 li a1,0 tail memset .L1: ret For coremark, this is not only harmful to performance, but also code size. Therefore, I suggest that we have to discuss how to resolve the case of unk= nown loop count.=