From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 473483858D38; Sun, 9 Oct 2022 10:33:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 473483858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665311597; bh=J3UTii41aVARoEy7OmcNkj3o+kJ/qfXmmX1qnAzywB4=; h=From:To:Subject:Date:From; b=CnKIeGK+nIU26wSDO/JkQWC7ewXU7hg4yET/ni+z+76VX2mywwiC1y7Ybxic8nzA7 5L+RjVoSGgoY250oLJjQEwHj9EPgNH/3eP4JOkI78JgZr3PvaoizecygZyVtfOMBB5 8bjTp15ZBrLkZ8pmHG0rtrx+wDwJqQUSjT6a3svU= From: "zhongyunde at huawei dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107190] New: [aarch64] regression with optimization -fexpensive-optimizations Date: Sun, 09 Oct 2022 10:33:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zhongyunde at huawei 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=3D107190 Bug ID: 107190 Summary: [aarch64] regression with optimization -fexpensive-optimizations Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhongyunde at huawei dot com Target Milestone: --- This case is simplify from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D1= 07090, and we can see that the codegen of function `test_m` has some regression wi= th optimization -fexpensive-optimizations, https://gcc.godbolt.org/z/zbKrEox4j This is because the pass 208t.widening_mul is controlled by -fexpensive-optimizations (default on at -O3), it conversion ``` m_12 =3D m_9 + m1_10; if (m1_10 > m_12) ``` into ``` _17 =3D .ADD_OVERFLOW (m_9, m1_10); m_12 =3D REALPART_EXPR <_17>; _18 =3D IMAGPART_EXPR <_17>; if (_18 !=3D 0)`` ```=