alloca bugfix

Nick Burrett nick at dsvr.net
Sat Dec 13 11:30:27 PST 2003


Hi,

I've spent ages trying to track down the problem with GCC not running on 
RISC OS.  To narrow the problem down, I did the following:

In unixlib::alloc.c, #define DEBUG 1.  This turns on extra malloc() 
sanity checking and stops RISC OS from simply locking up.  Upon error, 
malloc's internal functions call assert().

In unixlib::abort.c, I added a call to __write_corefile() so that we get 
a stack backtrace and can determine the likely area to look for code 
generation errors.

By process of elimination, I removed pthread support, tried Unixlib from 
2.95 and there was no difference.

It turned out I'd made an error in the insn for alloca in arm.md, which 
I'd attempted to optimised for register usage.

You'll need to do a full re-compile to remedy the code-generation 
errors, but you should at least find that it works now.

The next step is to fix exception handling in C++.

Regards,


Nick.





More information about the gcc mailing list