From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7C4653858D33; Fri, 14 Apr 2023 10:28:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7C4653858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681468135; bh=wxMBsMiwh0KAjS5GtIdMcrWl/CrqKtBbyw8Og0iOAow=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NWlrwGQ55LV+i74qJvuT2YXOxRrS6/ee64+PODd8QwGOFF/UoJrnPV1D319Dsy3KV opdBZ5Y5/VdasxmRTT//rPW+isT+oB8555Qu+Oa3ieVLOXsszatrM12H9JnRScqtVn 5KNG2CsTZKObxK9dXESTg60nzcOlsogh4gFP3vAI= From: "xry111 at gcc dot gnu.org" 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 10:28:55 +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: xry111 at gcc dot gnu.org 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 #18 from Xi Ruoyao --- (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 not? > That will cause those conversions to be missed. Looks like we should define it, as our psABI says: In most cases, the unsigned integer data types are zero-extended when store= d in general-purpose register, and the signed integer data types are sign-extend= ed. 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-b= it values. IIUC it matches the semantics of TARGET_PROMOTE_PROTOTYPES.=