https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106609
Jakub Jelinek <jakub at gcc dot gnu.org> 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 <jakub at gcc dot gnu.org> ---
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 returns
int.