From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DCF9B3832367; Thu, 24 Nov 2022 14:38:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DCF9B3832367 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669300695; bh=6YD8HTecziQDOw0b9yQBaA2ZIPhT3hL/QXlflAQ28uU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ntT5nfokLVHkmDsEFhB755ZkdBiqg2OPOO2FnEuj7UkzpkR98N8W3OznjeT82R6On jecksv7QP6YFXx4cy+eaSgkq5+cau7+OK1wCFxQm4ZBtnM/ZmEJ5W+QiJGw9b6r4NH gZM/RwxcmR7qAqHbEiI/g8DzXOxT54Nr11AAzvCc= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/106609] [12 Regression] sh3eb-elf cross compiler is being miscompiled since r12-1525-g3155d51bfd1de8b6c4645 Date: Thu, 24 Nov 2022 14:38:14 +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.1.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: blocker X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc priority short_desc 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=3D106609 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |law at gcc dot gnu.org Priority|P3 |P4 Summary|[12/13 Regression] |[12 Regression] sh3eb-elf |sh3eb-elf cross compiler is |cross compiler is being |being miscompiled since |miscompiled since |r12-1525-g3155d51bfd1de8b6c |r12-1525-g3155d51bfd1de8b6c |4645 |4645 --- Comment #14 from Jakub Jelinek --- Ugh, wasted time. This is (well, was) a SH backend bug, fixed apparently on the trunk by Jeff in r13-4118-ge214cab68cb34e77622b91113f7698cf137bbdd6 gcc/config/sh/sh_treg_combine.cc contained bogus // FIXME: Remove dependency on SH predicate function somehow. extern int t_reg_operand (rtx, machine_mode); extern int negt_reg_operand (rtx, machine_mode); declarations, when the definitions of those functions actually were bool t_reg_operand (rtx op, machine_mode mode ATTRIBUTE_UNUSED) { ... } bool negt_reg_operand (rtx op, machine_mode mode ATTRIBUTE_UNUSED) { ... } As x86_64 ABI on bool return only guarantees the state of the low 8 bits, the callee could leave garbage in the upper 56 bits of the %rax register, and then the caller would test 32 bits against zero as it was told it retur= ns int.=