From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BB9463858400; Tue, 27 Sep 2022 23:30:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB9463858400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664321407; bh=97Xh1W+dX9n2DJofwSglbgZPzbRu1h/kzmlrmuYdLZI=; h=From:To:Subject:Date:From; b=aWkC0/dTyzVXxztAZN8zEFaqloVty5Hzsibco24unGmyMxiOOSL0NUBFl6So6tsr6 3M+0c8f1FalVS+G2/v/sQaim7JL6kxRZt0Z1E44FlZZOWbRWIlm+eOJaRIDZSJ1rVA 2TkFcZz1b/LmMIt95sEhqxDdrQOdzMQ5wv5zRycM= From: "hiraditya at msn dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/107063] New: [X86_64 codegen] Using inc eax instead of inc dword ptr Date: Tue, 27 Sep 2022 23:30:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hiraditya at msn 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=3D107063 Bug ID: 107063 Summary: [X86_64 codegen] Using inc eax instead of inc dword ptr Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: hiraditya at msn dot com Target Milestone: --- int volatile gv =3D 0; void foo() { ++gv; } $ gcc -Os foo(): mov eax, DWORD PTR gv[rip] inc eax mov DWORD PTR gv[rip], eax ret gv: .zero 4 $ clang -Os foo(): # @foo() inc dword ptr [rip + gv] ret gv: .long 0=20=20=20 https://godbolt.org/z/vzq4jr5vj=