Ticket #218 (Fixed)Sat Sep 26 17:07:44 UTC 2009
cc 5.65 internal inconsistency when compiling RTSupport
Reported by: | Jeffrey Lee (213) | Severity: | Major |
Part: | RISC OS: C/C++ toolchain | Release: | |
Milestone: | Status | Fixed |
Details by Jeffrey Lee (213):
When attempting to compile the RTSupport module, cc 5.65 suffers an internal inconsistency error:
<pre>
cc -ffah -We -zM -zps1 -c -depend !Depend -DROM_MODULE -o modulerom.o module.c
Norcroft RISC OS ARM C vsn 5.65 [18 Apr 2006] (Jeffrey_Lee)
“c.module”, line 615: Fatal internal error: show_inst_dir(0X24)
Internal inconsistency: either resource shortage or compiler fault. If you
cannot alter your program to avoid this failure, please contact your supplier
</pre>
After poking around with the code a bit, it looks like it’s failing because it’s attempting to write to the last_executed field of the priority_t struct:
<pre>typedef __packed volatile struct
{
uint8_t next;
uint8_t usage;
uint16_t last_executed;
}
priority_t;
</pre>
Removing the __packed specifier makes the error go away, suggesting it’s a problem to do with packed structs. Removing the volatile specifier had no effect. The error seems to happen whether building for Cortex or Tungsten machine types, so it doesn’t look like it’s anything to do with the different -memaccess options.
Changelog:
Modified by Ben Avison (25) Wed, October 20 2010 - 01:11:04 GMT
- Status changed from Open to Fixed
This is fixed in cc 5.69, out soon. To work around it for older compilers, either select an architecture without halfword loads/stores, or refactor the uint16_t as two uint8_ts (simply removing “packed” will alter the memory layout, which in this case has to match the definition in the assembly sources).