From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 67AA43858D33; Fri, 14 Apr 2023 11:22:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 67AA43858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681471339; bh=MjB920yL69J9wKkVc/VJUxfdhuAne+GfzgTVp+keYGI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lZxjhiQ30wGLa9/Rh1lDiW0c3an0P+tS1FXRbin66HuzINH4RQpknT3dh0k7Smvb5 nhfzEx39yjyvQCmB1qL9UFWdPIihyzTtakk0LEeZFjWnC8hNVGdvEeAFlmIuY8Dsxq /7KoHbg0g0tKBkJdhPgP9fhI9N0qMF1qAcPDGcCg= From: "chenglulu at loongson dot cn" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108357] [13 Regression] Dead Code Elimination Regression at -O2 since r13-4607-g2dc5d6b1e7ec88 Date: Fri, 14 Apr 2023 11:22:19 +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: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: chenglulu at loongson dot cn X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 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=3D108357 --- Comment #19 from chenglulu --- (In reply to Xi Ruoyao from comment #18) > (In reply to Richard Biener from comment #17) > > Isn't this the same issue as seen in another bug, most targets defining > > TARGET_PROMOTE_PROTOTYPES to hook_bool_const_tree_true but loongarch no= t? > > That will cause those conversions to be missed. >=20 > Looks like we should define it, as our psABI says: >=20 > In most cases, the unsigned integer data types are zero-extended when sto= red > in general-purpose register, and the signed integer data types are > sign-extended. However, in the LP64D ABI, unsigned 32-bit types, such as > unsigned int, are stored in general-purpose registers as proper sign > extensions of their 32-bit values. >=20 > IIUC it matches the semantics of TARGET_PROMOTE_PROTOTYPE I also think this should be considered=