https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111581
Bug ID: 111581 Summary: [arm-none-eabi-gcc] / suboptimal optimization / Product: gcc Version: 9.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: cptarse-luke at yahoo dot com Target Milestone: --- it seems like, i should have filed this separately: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111500 i think the uxth/sxth is superfluous here, since nobody ever looks at the high half word... > arm-none-eabi-gcc -v Using built-in specs. COLLECT_GCC=arm-none-eabi-gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-none-eabi/9.3.0/lto-wrapper Target: arm-none-eabi Configured with: ../configure --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-libstdc__-v3 --disable-nls --disable-shared --disable-threads --disable-tls --disable-werror --enable-__cxa_atexit --enable-c99 --enable-gnu-indirect-function --enable-interwork --enable-languages=c,c++ --enable-long-long --enable-multilib --enable-plugins --host= --libdir=/usr/lib --libexecdir=/usr/lib --prefix=/usr --target=arm-none-eabi --with-gmp --with-gnu-as --with-gnu-ld --with-headers=/usr/arm-none-eabi/include --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-isl --with-libelf --with-mpc --with-mpfr --with-multilib-list=rmprofile --with-native-system-header-dir=/include --with-newlib --with-python-dir=share/gcc-arm-none-eabi --with-sysroot=/usr/arm-none-eabi --with-system-zlib Thread model: single gcc version 9.3.0 (GCC) > arm-none-eabi-gcc -save-temps -S a.c -O3 -g -mcpu=cortex-m0plus -mthumb -Wall > --specs=nosys.specs -nostdlib -fdata-sections -ffunction-sections > -ffreestanding -Winline > cat a.i # 1 "a.c" # 1 "/tmp//" # 1 "<built-in>" # 1 "<command-line>" # 1 "a.c" void artiSXTH(volatile short * a) { short b = *a; *a = b; } > cat a.s artiSXTH: ldrh r3, [r0] sxth r3, r3 strh r3, [r0] bx lr