Bug in scalar_storage_order("big-endian")

Bug #1818326 reported by Tony
6
This bug affects 1 person
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-eabi-gcc.exe -c -oBigEndianBug.o -march=armv6-m -mthumb -Wall -Wa,-a,-adn -O1 BigEndianBug.c >BigEndianBug.lst

Compiler version:

arm-none-eabi-gcc.exe (GNU Tools for Arm Embedded Processors 8-2018-q4-major) 8.2.1 20181213 (release) [gcc-8-branch revision 267074]

(but these problems were also there in version 7 2018-q2-update).

Running on Windows 10.

Tags: big-endian
Tony (tonyk)
description: updated
Tony (tonyk)
description: updated
Revision history for this message
Tony (tonyk) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.