From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 38FF43858D1E; Sun, 6 Aug 2023 11:35:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 38FF43858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691321730; bh=um9Qb6TDJbNSltdJ8vRy50q5fjJzimPabTVE28hxbz4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=bYFuyUEQyNDquv2K5rRzCdeXAEX9TwDSj9guadku3GapViUehJ8kV3wSUXtgAX8En M2LNvr2Cxt5m6hcqOr3juZOys32ghNjUknrWA3rodx+Xod0epLY+VqdyGxYQVdVoaY gYpQn4VLlgEiloJ1e/MgYfK9aNTteNXzAqmNeefQ= From: "scherrer.sv at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110919] [14 Regression] Dead Code Elimination Regression at -O3 since r14-1691-gbc5a2c2e793 Date: Sun, 06 Aug 2023 11:35:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: Message-ID: In-Reply-To: References: 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 --- Comment #1 from Scherrer Svenja --- My apologies, the assembly above is incomplete. The following shows the bug gcc-87b0749cfb9406790b108208b466cf507ae3c431 -O3 case.c -S -o case.s --------- OUTPUT --------- .file "case.c" .text .p2align 4 .type g, @function g: .LFB3: .cfi_startproc pushq %rbx .cfi_def_cfa_offset 16 .cfi_offset 3, -16 movl %esi, %ebx testw %di, %di jne .L2 xorl %eax, %eax testl %esi, %esi sete %al .L3: movl e(%rip), %edx cmpl %eax, %edx sete %cl testl %edx, %edx setne %dl testb %dl, %cl je .L1 testl %eax, %eax je .L15 .L1: popq %rbx .cfi_remember_state .cfi_def_cfa_offset 8 ret .L2: .cfi_restore_state call bar151_ testl %ebx, %ebx je .L1 call bar162_ xorl %eax, %eax jmp .L3 .L15: popq %rbx .cfi_def_cfa_offset 8 jmp foo .cfi_endproc .LFE3: .size g, .-g .section .text.startup,"ax",@progbits .p2align 4 .globl main .type main, @function 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 .cfi_endproc .LFE4: .size main, .-main .local e .comm e,4,4 .ident "GCC: (GNU) 14.0.0 20230806 (experimental)" .section .note.GNU-stack,"",@progbits ---------- END OUTPUT --------- ----------------------------------------------------------------------- gcc-2b98cc24d6af0432a74f6dad1c722ce21c1f7458 -O3 case.c -S -o case.s --------- OUTPUT --------- .file "case.c" .text .p2align 4 .type g, @function g: .LFB3: .cfi_startproc testw %di, %di jne .L11 ret .L11: pushq %rbx .cfi_def_cfa_offset 16 .cfi_offset 3, -16 movl %esi, %ebx call bar151_ testl %ebx, %ebx je .L1 popq %rbx .cfi_remember_state .cfi_restore 3 .cfi_def_cfa_offset 8 jmp bar162_ .L1: .cfi_restore_state popq %rbx .cfi_def_cfa_offset 8 ret .cfi_endproc .LFE3: .size g, .-g .section .text.startup,"ax",@progbits .p2align 4 .globl main .type main, @function 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 .cfi_endproc .LFE4: .size main, .-main .ident "GCC: (GNU) 13.1.0" .section .note.GNU-stack,"",@progbits ---------- END OUTPUT ---------=