From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B07493806BF1; Wed, 5 Jun 2024 05:37:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B07493806BF1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1717565854; bh=9KJ5v/IEhJ0vAQYKPe3VyGerKXu6G1hV+KTJvjn54EM=; h=From:To:Subject:Date:From; b=o2cVRdZ68uMhseyN7QKbG+9DuUDTih0sENr9DRfU4zOxZAvjHg0Y3MZffYZ2FHlwF 5JcRE7IjkE82QaY0Rjw6d0l+AsS9EbhaHqCNJwseryl+KT41lnNdXMY4DRUXJeyAPR VZ6K5E4Gk0r9OzDzcPYZydPYbZYyCUwKGuc3jfuY= From: "gus at projectgus dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/115354] New: Large -Os code size increase related to -ftree-sra Date: Wed, 05 Jun 2024 05:37:33 +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: 14.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gus at projectgus 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 attachments.created 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D115354 Bug ID: 115354 Summary: Large -Os code size increase related to -ftree-sra Product: gcc Version: 14.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: gus at projectgus dot com Target Milestone: --- Created attachment 58353 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D58353&action=3Dedit Source file shows code size increase in mp_parse function After upgrading arm-none-eabi-gcc from 13.2 to 14.1 we noticed some increas= es in code size when compiling the MicroPython project with -Os. Bisecting turned up a commit that introduces a 15% code size increase in an (admittedly quite complex) function. The commit is aae723d3 "sra: SRA of non-escaped aggregates passed by refere= nce to calls". GCC 13.2 and the parent of commit aae723d3 both produce a 2846 byte text section when building the attached code. GCC 14.1, commit aae723d3, and recent master branch all produce a 3282 byte text section. Full compiler command line is "arm-none-eabi-gcc -Wall -Wextra -std=3Dc99 -mcpu=3Dcortex-m4 -Os -c" If -fno-tree-sra argument is added then the text section reverts to 2846 by= tes. Assembler output from commit aae723d3 passing -fno-tree-sra is identical to output from the parent commit without -fno-tree-sra. Unfortunately the function is quite complex and includes gotos and calls to noreturn functions. I haven't been able to isolate a smaller test case but I thought it was worth reporting anyway, as the size jump is quite noticeable. Version and configuration details for the local test builds: > Target: arm-none-eabi > Configured with: /home/gus/dev/gcc/configure --target=3Darm-none-eabi --p= refix=3D/home/gus/ry/george/tmp/gcc-temp-aae723d3 --with-sysroot=3D/home/gu= s/ry/george/tmp/gcc-temp-aae723d3/arm-none-eabi --enable-languages=3Dc --en= able-plugins --disable-decimal-float --disable-libffi --disable-libgomp --d= isable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcx= x-pch --disable-nls --disable-shared --disable-threads --disable-tls --with= -gnu-as --with-gnu-ld --with-system-zlib --with-newlib --with-headers=3D/ho= me/gus/ry/george/tmp/gcc-temp-aae723d3/arm-none-eabi/include --with-python-= dir=3Dshare/gcc-arm-none-eabi --with-gmp --with-mpfr --with-mpc --with-isl = --with-libelf --enable-gnu-indirect-function --with-host-libstdcxx=3D'-stat= ic-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-multilib-list=3Drmpro= file > gcc version 14.0.0 20231124 (experimental) (GCC)=