From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 656BF3858D38; Sun, 6 Aug 2023 11:05:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 656BF3858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691319946; bh=0WSMjhO5XzTT6zKiY2V8k42SO6ADBvSx9enaXCg8454=; h=From:To:Subject:Date:From; b=IdIRxh9PCcGkR2lu5DZalo9s4wR/KCRgCDCt1rkEmUeXbmi9FtZDTATEcit9YoZYl RGF3RW4FNfSZHjfg30MaCEEqPdvow7Y9zCBnhcc/NnyMoK2I8ruo3JVZB7yTjishaY Zb1aBhYdogzObK2eSKRignCy7DOHPZ5HmQ1pGl6w= From: "scherrer.sv at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110919] New: [14 Regression] Dead Code Elimination Regression at -O3 since r14-1691-gbc5a2c2e793 Date: Sun, 06 Aug 2023 11:05:46 +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.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: scherrer.sv 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 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=3D110919 Bug ID: 110919 Summary: [14 Regression] Dead Code Elimination Regression at -O3 since r14-1691-gbc5a2c2e793 Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: scherrer.sv at gmail dot com Target Milestone: --- static short a, b; static int e; static int *j =3D &e; void bar151_(void); void foo(void); void bar162_(void); static int(d)(int k, int l) { return l =3D=3D k && l - 1 ? k : 0; } static void f(); static void g(unsigned short, unsigned); static void h() { g(0, 4); f(); int i =3D -1; g(0, i); } static void f(int k) { g(k, 0); } static void g(unsigned short k, unsigned l) { if (k) bar151_(); if (l) if (k) bar162_(); short c =3D l; b =3D c =3D=3D 0 || a; if (d(*j, b)) foo(); } int main() { h(); } gcc-87b0749cfb9 (trunk) -O3 cannot eliminate the call to foo but gcc-releases/gcc-13.1.0 -O3 can. ----------------------------------------------------------------------- gcc-87b0749cfb9406790b108208b466cf507ae3c431 -O3 case.c -S -o case.s --------- OUTPUT --------- main: .LFB4: .cfi_startproc subq $8, %rsp .cfi_def_cfa_offset 16 movl $4, %esi xorl %edi, %edi call g xorl %esi, %esi xorl %edi, %edi call g movl $-1, %esi xorl %edi, %edi call g xorl %eax, %eax addq $8, %rsp .cfi_def_cfa_offset 8 ret ---------- END OUTPUT --------- ----------------------------------------------------------------------- gcc-2b98cc24d6af0432a74f6dad1c722ce21c1f7458 -O3 case.c -S -o case.s --------- OUTPUT --------- main: .LFB4: .cfi_startproc subq $8, %rsp .cfi_def_cfa_offset 16 movl $4, %esi xorl %edi, %edi call g xorl %esi, %esi xorl %edi, %edi call g movl $-1, %esi xorl %edi, %edi call g xorl %eax, %eax addq $8, %rsp .cfi_def_cfa_offset 8 ret ---------- END OUTPUT --------- ----------------------------------------------------------------------- Bisects to r14-1691-gbc5a2c2e793=