In [r14305] I added more regression tests for shifts of wide variables. Some of them fail; apparently only ports that use support functions for shifts of such variables are affected.
Bugs: #3619
Commit: [r14305]
Discussion: [SDCC 4.3.0][MCS51] bug adding int64_t constants using liblonglong
Discussion: [SDCC 4.3.0][MCS51] bug adding int64_t constants using liblonglong
Wiki: SDCC 4.4.0 Release
As of now ([r14308]), I only see a few remaining failures. All for mcs51 and the small memory model (the failures are the same both with and without --stack-auto):
P.S.: The test currently does not use as many values for the shift count as I will want to use later, due to an issue in the regtest infrastructure. I think I would otherwise see a higher number of failures (at different shift counts, but the same widths and storage classes).
Related
Commit: [r14308]
Last edit: Philipp Klaus Krause 2023-08-17
Actually, this is not about the support functions. For the failing shift tests, code is generated directly by the mcs51 backend. After all, mcs51 never uses support routines for shifts.
An example from gen/mcs51-small/bitintshift/bitintshift_width_33_count_1_varstorage_auto_countstorage_auto_direction_1.lst (code generated for the shift itself is correct, but the return value of a call is messed up):
The value in r4 is overwritten before it is used. While in this test, the error is seen for an
unsigned _BitInt
, I think the same problem can affect anunsigned long long
.P.S.: The wrong code is generated in
assignResultValue
ingen.c
.Last edit: Philipp Klaus Krause 2023-09-01
IMO, the best way forward for fixing this and related issues is to implement the whole
genMove_o
andgenCopy
machinery we have in some other ports, such as stm8: Helper functions that will try to move data from (part of) one asmop to another as efficiently as possible, and being able to deal with virtually any complications, such as overlapping source/destination.As of [r14339], the failing parts of the test is disabled for mcs51-small.
Related
Commit: [r14339]
Fixed in [r14398].
Related
Commit: [r14398]