[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help requested for htslib build failure on ppc64el

Hi Michael,

On 12/27/2018 04:35 PM, Gustavo Romero wrote:
On 12/27/2018 12:41 PM, Michael Crusoe wrote:

Can I get some assistance here? Rebuilding using Qemu and the earlier source packages produces the same error, so maybe this is a regression in the compiler?

I'm not sure if it's a compiler regression, but I can only reproduce that
with gcc-8. Compiling with gcc-7 is fine.

I can see it fails with gcc-8 plus -O3, but not with -O2, because:

(gdb) call bam_auxB2f(p, i)
$5 = -3.141589879989624
(gdb) call (float) bam_auxB2f(p, i)
$1 = -3.14158988
(gdb) p bfvals[i]
$6 = -3.14159012

(gdb) call bam_auxB2f(p, i)
$1 = -3.1415901184082031
(gdb) call (float) bam_auxB2f(p, i)
$4 = -3.14159012
(gdb) p bfvals[i]
$2 = -3.14159012

Actually gcc will promote type float to double I think, but comparison will
fail anyway...

So, the code for this lib seems a little bit suspicious with all those cast /
missing casts, union (to convert uint32_t array to float), and different ways to
convert uint8_t* to uint32_t, like in le_to_u32(). So some implicit truncation
might be working by luck on gcc7 and gcc8 plus -O2 but optimization (O3) "broke"

I can take a closer look tomorrow if nobody else bites the bait.



Michael R. Crusoe
Co-founder & Lead, Common Workflow Language project <http://www.commonwl.org/>
Direktorius, VšĮ "Darbo eigos", Vilnius, Lithuania
https://orcid.org/0000-0002-2961-9670 <https://impactstory.org/u/0000-0002-2961-9670>
mrc@commonwl.org <mailto:mrc@commonwl.org>
+1 480 627 9108 / +370 653 11125

Reply to: