Bug in scalar_storage_order("big-endian")
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Arm Embedded Toolchain |
New
|
Undecided
|
Unassigned |
Bug Description
If a 16-bit integer is loaded from memory as a little-endian, and then immediately again as a big-endian, the compiler optimises away the second load, but forgets to switch its endianness. The attached file BigEndianBug.c shows the problem: f2 returns 0x1234 instead of the expected 0x3412.
Incidentally, there is a minor problem in f1 too: the uxth instruction is redundant. (This is still the case at optimisation level O3.)
Compile command:
arm-none-
Compiler version:
arm-none-
(but these problems were also there in version 7 2018-q2-update).
Running on Windows 10.