-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Division by non-multiple of 2 causes compiler to crash #426
Comments
This seems really important to fix ASAP. Other optimization levels produce faster code, often significantly. Additionally, I've found that they may even produce a smaller binary because inlining, as long as it's not excessive, actually saves space due to omitting all the value juggling necessary when every function is emitted as an actual function. Even if the fix is just to make these non-multiple-of-two divisions call the general division routine instead of using some optimized multiply trick, slow code is better than no code. |
Fixed in latest compiler version. in _a:
call __frameset0
ld hl, (ix + 6)
ld bc, 3
call __idivu
pop ix
ret in _a:
ld iy, 0
add iy, sp
ld hl, (iy + 3)
ld iy, -5592405
ld de, 0
ld.sis bc, 0
push de
push de
push iy
call __llmulu
ld iy, 9
add iy, sp
ld sp, iy
ld bc, -1
ld iy, 0
push iy
push bc
push bc
call __lland
ld iy, 9
add iy, sp
ld sp, iy
ld iy, 24
push iy
call __llshru
pop de
ld c, 1
call __ishru
ret in _a:
push ix
ld ix, 0
add ix, sp
ld hl, -3
add hl, sp
ld sp, hl
ld hl, (ix + 6)
ld (ix - 3), hl
ld hl, (ix - 3)
ld iy, -5592405
ld de, 0
ld.sis bc, 0
push de
push de
push iy
call __llmulu
ld iy, 9
add iy, sp
ld sp, iy
ld bc, -1
ld iy, 0
push iy
push bc
push bc
call __lland
ld iy, 9
add iy, sp
ld sp, iy
ld iy, 24
push iy
call __llshru
ld iy, 3
add iy, sp
ld sp, iy
ld c, 1
call __ishru
ld iy, 3
add iy, sp
ld sp, iy
pop ix
ret |
This causes a compiler crash when compiled with any
-O
flag except-Oz
:=> See here jacobly0/llvm-project#12
The text was updated successfully, but these errors were encountered: