Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i#6524: Fix udivmoddi4.c 32-bit linux build fail and semantics #6526

Merged
merged 5 commits into from
Feb 13, 2024

Conversation

xdje42
Copy link
Contributor

@xdje42 xdje42 commented Dec 21, 2023

For the targets we care about LIBGCC2_UNITS_PER_WORD == 4 (SImode in GCC parlance).
Thus a double word is 8 bytes (DImode in GCC parlance).

Previously, __moddi3 was using a mix of word and double word widths,
causing a compilation failure on 32 bit linux with the Debian 13.2.0-4 compiler.
The semantics were also incorrect: inputs and outputs should be 64 bits for the
hosts we care about (x86, aarch, 32 and 64 bit, and riscv64).

Fixes: #6524

xdje42 and others added 3 commits December 21, 2023 15:18
SI mode in GCC is 32 bits, regardless of architecture,
and DI mode is 64 bits. Previously __moddi3 was working
with 32 bit arguments and returning a 32 bit result.
Changed to work with 64 bit values.

Fixes: #6524
@xdje42 xdje42 changed the title i#6524 udivmoddi4.c build fail: Use same types as libgcc i#6524 udivmoddi4.c build fail: Use same int widths as libgcc Feb 12, 2024
@xdje42 xdje42 changed the title i#6524 udivmoddi4.c build fail: Use same int widths as libgcc i#6524: Fix udivmoddi4.c build fail on 32-bit linux Feb 12, 2024
@xdje42 xdje42 changed the title i#6524: Fix udivmoddi4.c build fail on 32-bit linux i#6524: Fix udivmoddi4.c 32-bit linux build fail and semantics Feb 12, 2024
third_party/libgcc/udivmoddi4.c Show resolved Hide resolved
third_party/libgcc/udivmoddi4.c Outdated Show resolved Hide resolved
@xdje42 xdje42 merged commit 6366e1e into master Feb 13, 2024
16 checks passed
@xdje42 xdje42 deleted the i6524-udivmoddi4-build-fail branch February 13, 2024 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

libgcc/udivmoddi4.c uses different types from GCC
2 participants