mirror of
https://github.com/cc65/cc65.git
synced 2024-12-27 00:29:31 +00:00
parent
6974c1ff12
commit
9ec9d1e20c
33
test/val/bug1431.c
Normal file
33
test/val/bug1431.c
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
$ cl65 -Osir --codesize 180 -S -o main.s main.c
|
||||
main.c(9): Internal compiler error:
|
||||
Code generation messed up: StackPtr is -2, should be -4
|
||||
|
||||
Input: if (wcnt > btw) {
|
||||
|
||||
$ git bisect bad
|
||||
aa6fdf58b8a17b747090fb521f3d9106e0c56d1c is the first bad commit
|
||||
commit aa6fdf58b8a17b747090fb521f3d9106e0c56d1c
|
||||
Author: acqn <acqn163@outlook.com>
|
||||
Date: Mon Feb 8 09:03:19 2021 +0800
|
||||
|
||||
Addresses in constant subtraction expressions now work.
|
||||
Fixed codegen for cast type subtraction in constant expressions.
|
||||
*/
|
||||
|
||||
unsigned long fptr = 0x40001;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
unsigned int btw = 500;
|
||||
unsigned int wcnt;
|
||||
|
||||
wcnt = 512U - (fptr % 512U);
|
||||
|
||||
if (wcnt > btw) {
|
||||
wcnt = btw;
|
||||
}
|
||||
|
||||
return wcnt == 500 ? 0 : 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user