From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D3D013858CDB; Wed, 1 Mar 2023 04:04:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D3D013858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677643473; bh=sdHNkpGulMYKuZuzP9a5oWdW3durgK9RmezbGJYG4sE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Wif8S5GzpT4sPuooDYbf0p28SUxwJdh5WPgmpbctZbNyM7YmbzR3Ad2gRiS4WsiU0 lbi3jFJdGGR8OoJ91dK9H9mGsgjWypVlf03XWfWQvAobVehcbyZ4WFENWYGzlp+H98 haTpE2CWdi4nzp7b5emdpueXjV/HzS0zKmj7L6Lk= From: "jskumari at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/103784] suboptimal code for returning bool value on target ppc Date: Wed, 01 Mar 2023 04:04:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: jskumari at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jskumari 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=3D103784 --- Comment #9 from Surya Kumari Jangala --- The same issue of unnecessary rldicl instruction is there if we change retu= rn value from bool to int. int foo (int a, int b) { if (a > 2) return 0; if (b < 10) return 1; return 0; } cmpwi 0,3,2 bgt 0,.L3 subfic 4,4,9 srdi 3,4,63 xori 3,3,0x1 rldicl 3,3,0,63 blr .p2align 4,,15 .L3: li 3,0 rldicl 3,3,0,63 blr=