From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8B114395BC0E; Sun, 20 Nov 2022 13:02:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B114395BC0E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668949352; bh=/hx16xUAJeUtyGHk7vPT7/VMTeALO1sY/atkbeTrChM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QEf71VTAothcyRXApDFhrfD8TPQkwxagGs3gR/c9sEPOcBlUKrlp/QzmvNEXFhT/E 5FHrt3YxDIsDl9W+Y9xa716EBPEB6RfPs9jFfAhEfB3JuUGLuwO1F9VRssX4ES0ieY +Is0bIA/CcP1fkb7NO3EAtk4AQaxt8YJfIBoQJMY= From: "socketpair at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug regression/107767] GCC has some problems in optimizer of trivial case Date: Sun, 20 Nov 2022 13:02:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: regression X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: socketpair 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=3D107767 --- Comment #1 from =D0=9A=D0=BE=D1=80=D0=B5=D0=BD=D0=B1=D0=B5=D1=80=D0=B3 = =D0=9C=D0=B0=D1=80=D0=BA --- See assembler output for firewall2(). It's not -Os optimized (compare to firewall(), which is ok) ``` firewall: movw 64(%rdi), %ax cmpb $17, (%rdi) sete %cl leal -15(%rax), %edx testw $-9, %dx movb $1, %dl sete %sil cmpw $47, %ax ja .L2 movabsq $-180319906955279, %rdx btq %rax, %rdx setc %dl .L2: movl %edx, %eax xorl $1, %eax orl %esi, %eax andl %ecx, %eax movzbl %al, %eax ret firewall2: movw 64(%rdi), %ax xorl %edx, %edx decl %eax cmpw $46, %ax ja .L5 movzwl %ax, %eax movsbl CSWTCH.2(%rax), %edx .L5: movl %edx, %eax ret CSWTCH.2: .byte 1 .byte 1 .byte 1 .byte 0 .byte 0 .byte 0 .byte 0 .byte 0 .byte 0 .byte 0 .byte 0 .byte 0 .byte 0 .byte 0 .byte 1 .byte 0 .byte 0 .byte 0 .byte 0 .byte 0 .byte 0 .byte 0 .byte 1 .byte 0 .byte 0 .byte 0 .byte 0 .byte 0 .byte 0 .byte 0 .byte 0 .byte 0 .byte 0 .byte 0 .byte 0 .byte 0 .byte 0 .byte 0 .byte 0 .byte 0 .byte 0 .byte 1 .byte 0 .byte 0 .byte 1 .byte 0 .byte 1 ```=