affects 871514 + ngircd
found 871514 7.2.0-1
thanks
James Cowgill wrote...
> On 22/08/17 17:51, Christoph Biedl wrote:
> > Ultimately, after rebuilding on mips64el using -O0 the test suite
> > passes. Although it's usually premature to assume it: This smells like
> > a compiler bug.
>
> This is very likely #871514 in gcc-7. Unfortunately it is affecting a
> lot of packages in the archive at the moment causing incorrect code to
> be generated.
Ouch, I see a huge binNMU job approaching.
> The bug happens if a "small" variable is spilled to the stack. GCC may
> emit a store of the smaller size to the stack, but then load it back as
> a 64-bit integer. The top bits of the register will then contain some
> garbage on the stack and cause comparisons like in your example to fail
> (the bottom bits will be 0 but the top bits won't be).
Thanks for sharing, this seems to be the case indeed:
| ./src/ngircd/irc-mode.c:725
| if(!is_oper && !is_machine && !is_owner && !is_admin) {
| 29aa8: 16c00141 bnez s6,29fb0 <Channel_Mode+0xd58>
| 29aac: 0257102a slt v0,s2,s7
| ./src/ngircd/irc-mode.c:725 (discriminator 1)
! 29ab0: dfa20000 ld v0,0(sp)
| 29ab4: 1440013e bnez v0,29fb0 <Channel_Mode+0xd58>
| 29ab8: 0257102a slt v0,s2,s7
| ./src/ngircd/irc-mode.c:725 (discriminator 2)
! 29abc: dfa20018 ld v0,24(sp)
| 29ac0: 144000c5 bnez v0,29dd8 <Channel_Mode+0xb80>
| 29ac4: 0257102a slt v0,s2,s7
| ./src/ngircd/irc-mode.c:725 (discriminator 3)
! 29ac8: dfa20020 ld v0,32(sp)
| 29acc: 10400465 beqz v0,2ac64 <Channel_Mode+0x1a0c>
The type of the four variables is "bool", so it's certainly something
smaller.
Christoph
Attachment:
signature.asc
Description: Digital signature