From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8996B3858CD1; Fri, 11 Aug 2023 13:08:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8996B3858CD1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691759323; bh=fpuzdTvQNrm+jnh1s8pmMwvq5RPktbrjHfRMcqCYAxE=; h=From:To:Subject:Date:From; b=yliIEak19ZrQBgJ15fNLjJ+6JfDE2KLRlYw/XRG25MpUYmgV4ckKtUt/xRv2bxm+r esfWNG5FPdIKIpHQupFgWFgKsE43WnfTql+/yBfHVRfc0YVUGKUz/pPqg6ws7vQX1H ZS30/1++YnawQsDQB6wJFdRpgVSvo+dAnZkdDt6I= From: "scherrer.sv at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110991] New: [14 Regression] Dead Code Elimination Regression at -O2 since r14-1135-gc53f51005de Date: Fri, 11 Aug 2023 13:08:42 +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=3D110991 Bug ID: 110991 Summary: [14 Regression] Dead Code Elimination Regression at -O2 since r14-1135-gc53f51005de 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 unsigned char a; static char b; void foo(void); int main() { a =3D 25; for (; a > 13; --a) b =3D a > 127 ?: a << 3; if (!b) foo(); } gcc-3a13884b23a (trunk) -O2 cannot eliminate the call to foo but gcc-releases/gcc-13.1.0 -O2 can. ----------------------------------------------------------------------- gcc-3a13884b23ae32b43d56d68a9c6bd4ce53d60017 -O2 case.c -S -o case.s --------- OUTPUT --------- main: .LFB0: .cfi_startproc movd .LC0(%rip), %xmm0 movd .LC1(%rip), %xmm1 xorl %eax, %eax .L2: addl $1, %eax movdqa %xmm0, %xmm2 paddb %xmm1, %xmm0 cmpl $3, %eax jne .L2 movdqa %xmm2, %xmm0 movb $13, a(%rip) paddb %xmm2, %xmm0 paddb %xmm0, %xmm0 movdqa %xmm0, %xmm1 paddb %xmm0, %xmm1 pxor %xmm0, %xmm0 pcmpgtb %xmm2, %xmm0 movd .LC2(%rip), %xmm2 pand %xmm0, %xmm2 pandn %xmm1, %xmm0 por %xmm2, %xmm0 movd %xmm0, %eax sarl $24, %eax movb %al, b(%rip) testb %al, %al je .L10 xorl %eax, %eax ret .L10: pushq %rax .cfi_def_cfa_offset 16 call foo xorl %eax, %eax popq %rdx .cfi_def_cfa_offset 8 ret ---------- END OUTPUT --------- ----------------------------------------------------------------------- gcc-2b98cc24d6af0432a74f6dad1c722ce21c1f7458 -O2 case.c -S -o case.s --------- OUTPUT --------- main: .LFB0: .cfi_startproc movb $112, b(%rip) xorl %eax, %eax movb $13, a(%rip) ret ---------- END OUTPUT --------- ----------------------------------------------------------------------- Bisects to r14-1135-gc53f51005de=