According to the snapshots page, the regression test gte/20040307-1.c fails for macOS on PowerPC, which is currently the only big-endian system in the compile farm.
The "ora #0x00" should be "ora #0x01". However, if the underlying literal value was truly 0, the ora instruction should be omitted, which implies that the literal value is not actually 0 but somehow still converts to "00" with the %02x formatting specifier.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That looks like it could be the bug: %02x is a format specifier for an unsigned int. The argument is a signed int.
P.S.: Actually, litval is a unsigned long cast to signed int cast to unsigned long long. So %02llx should be correct. I'll put that into the next branch.
Last edit: Philipp Klaus Krause 2023-06-30
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I can confirm that incorrect code is being generated:
The "ora #0x00" should be "ora #0x01". However, if the underlying literal value was truly 0, the ora instruction should be omitted, which implies that the literal value is not actually 0 but somehow still converts to "00" with the %02x formatting specifier.
That looks like it could be the bug:
%02xis a format specifier for anunsigned int. The argument is asigned int.P.S.: Actually, litval is a unsigned long cast to signed int cast to unsigned long long. So
%02llxshould be correct. I'll put that into the next branch.Last edit: Philipp Klaus Krause 2023-06-30
Fixed in the next branch in [r14194].
Related
Commit: [r14194]
Fixed in [r14211] by merging next to trunk.
Related
Commit: [r14211]