Closed ryandesign closed 1 year ago
I was compiling with -opt all
(all optimizations). If I change -opt all
to -opt off
(no optimizations) then it is able to compile the large file in 16MB of memory, and there are other levels of optimization I can try, so that's a workaround at least.
As a complete shot in the dark, you could try commenting out the
if (MemorySize <= 0x00ffffff)
address &= 0x00ffffff;
lines in mm.cpp.
Yeah that does seem like an obvious place, only the toolbox trace log doesn't show StripAddress
ever being invoked.
Comment out
memorySetAddress32Bit(FALSE);
in cpu/fmem.c, perhaps?
Can you provide some sample code for triggering it?
I recreated with a small file. _ResolveAliasFile was clobbering the stack by writing 2 bytes (instead of 1) for the targetIsFolder/isAliased ptrs (which were local variables and therefore on the stack). It should be fixed now 2dcb161f5e527f9f8a83cba73a72edc984d89588
_ResolveAliasFile was clobbering the stack
That would certainly do it! Thanks for finding and fixing that. The compile now succeeds with optimizations in 22MB RAM. Thanks @jduerstock for your suggestions too.
I'm having this error from CodeWarrior Pro 5's MWC68k/MWCPPC when compiling one particular file:
Many smaller files compiled fine but this file is over 3,000 lines long so maybe that's to be expected. "No problem," I thought. "I'll just give mpw more RAM." Since the default RAM is 16MB I re-ran mpw with
--ram=48M
. To my surprise, mpw exited with code 0 but did not compile the file. No files compile with this setting, not even tiny ones. In fact--ram=17M
is the highest I can go and still have it work, but 17MB is still not enough to compile this file.Here's where it goes off the rails with
--ram=48M
:I've abbreviated the file path in the logs here for the sake of ... brevity.
The
RTS
should be going back to 02C20B22 but for some reason it's returning to 00C20B22 instead, where there isn't any code, like it's truncating the return address to 24-bit.There are many other subroutines before this point that returned just fine.
ResolveAliasFile
was called 11 times successfully before this failure on the 12th time.Here's a successful run of mpw with
--ram=16M
for comparison: