Tool/software: TI C/C++ Compiler
Team,
One of my customers sometimes gets data abort errors. It's due to an unaligned access via the STM instruction, even if compiler option unaligned_access=on is set. They debugged their code and created the following code snipped to reproduce the issue:
uint8_t array[42];
uint64_t dummyValue = 0x11111111FFFFFFFFu;
*(uint64_t*)&array[1]= dummyValue;
The compiler creates a STM instruction for the last line. If uint32_t instead of uint64_t is used, then no error occurs.
How is the behavior of unaligned_access=on? Shouldn't all data accesses use unaligned instructions?
Compiler version used: TI Compiler 5.2.9
Compiler flags:
--compile_only -mv7R4 --code_state=32 --float_support=VFPv3D16 --abi=eabi -O4 --fp_mode=strict --opt_for_speed=5 -g --symdebug:dwarf_version=3 --c99 --c++03 --diag_warning=225 --emit_warnings_as_errors --diag_wrap=off --display_error_number --sat_reassoc=off --unaligned_access=on --enum_type=packed --common=off --fp_reassoc=off --plain_char=unsigned --embedded_constants=on --wchar_t=16
Linker flags:
--opt_level=4 --opt_for_speed=5 --emit_warnings_as_errors --run_linker --reread_libs --diag_wrap=off --display_error_number --warn_sections --rom_model --be32
Thanks,
Robert