Forum Discussion
Altera_Forum
Honored Contributor
21 years agoI don't have a copy of Nios v3.2 kit handy - does it include a newer version of GCC?
The bug does seem to be related to the -mflat option (avoid use of save/restore), since code compiled without the -mflat option always generates a stack frame using save and restore instructions. This is probably the root of the problem: the rest of the Nios specific code generation (mostly of which probably predates the -mflat option) likely assumes routines always have their own stack frame. Not using the -mflat option would be very difficult, as it would completely change what we need to do to save task context in our real time executive (need to save all register windows used by a task, not just current one). Moving to the Nios II might be a possibility, but it would mean re-writing some low level assembler code (the real-time executive context switching) and re-writing some of the hardware interface code. Does anyone know if the newer version of GCC included in the NiosII development kits is also capable of generating code for Nios, or does it only support the new NiosII target?