From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DFDE93858D28; Thu, 11 Nov 2021 23:59:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DFDE93858D28 From: "slyfox at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/103202] New: [12 regression] gcc miscompiles ed-1.17 Date: Thu, 11 Nov 2021 23:59:37 +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: 12.0 X-Bugzilla-Keywords: 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: 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 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: Thu, 11 Nov 2021 23:59:38 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103202 Bug ID: 103202 Summary: [12 regression] gcc miscompiles ed-1.17 Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: slyfox at gcc dot gnu.org Target Milestone: --- Created attachment 51774 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D51774&action=3Dedit main_loop.c Originally found the problem as a test failure on GNU ed-1.17 test suite. The test fails on gcc-12.0.0 20211107 snapshot and works on gcc-11.2.0 rele= ase. I shrunk test down to a single file, but was not able to figure out where t= he problem pops up: # gcc-11, good: $ ../result-1/bin/gcc -O2 main_loop.c -o a && ./a element 1 element 2 element 3 # gcc-12, bad: $ ../result-2/bin/gcc -O2 main_loop.c -o a && ./a element 1 element 2 $ LANG=3DC ../result-1/bin/gcc -v Using built-in specs. COLLECT_GCC=3D/nix/store/gsj6c88q5hf7fmaaym7023q92jvx1i20-gcc-11.2.0/bin/gcc COLLECT_LTO_WRAPPER=3D/nix/store/gsj6c88q5hf7fmaaym7023q92jvx1i20-gcc-11.2.= 0/libexec/gcc/x86_64-unknown-linux-gnu/11.2.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: Thread model: posix Supported LTO compression algorithms: zlib gcc version 11.2.0 (GCC) $ LANG=3DC ../result-2/bin/gcc -v Using built-in specs. COLLECT_GCC=3D/nix/store/1g16njhrdlhq61qh30c063jdmmz3hv4d-gcc-12.0.0/bin/gcc COLLECT_LTO_WRAPPER=3D/nix/store/1g16njhrdlhq61qh30c063jdmmz3hv4d-gcc-12.0.= 0/libexec/gcc/x86_64-unknown-linux-gnu/12.0.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: Thread model: posix Supported LTO compression algorithms: zlib gcc version 12.0.0 20211107 (experimental) (GCC)=