https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82811
Bug ID: 82811 Summary: Assembler error on tic6x-none-elf with march=c64x+ Product: gcc Version: 7.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: g.hoogewerf at gmail dot com Target Milestone: --- The following test case triggers an error on several versions of GCC, including 7.2.0 and 4.9.4. I tried several versions of binutils, including 2.20 and 2.26.1. long long test(long long a, long long b) { long long c = 0; c |= ((a & 0xFFFF) << 0); c |= (b << 16); return c; } To trigger the error, the source should be compiled with: "-march=c64x+ -O2". The error does not occur when building with "-march=c67x+". When running with -v -save-temps, the output is: Using built-in specs. COLLECT_GCC=./tools/i686-pc-linux-gnu/tic6x-none-elf/bin/tic6x-none-elf-gcc Target: tic6x-none-elf Configured with: /home/ghoogewerf/GccBuild/src/gcc/configure --prefix=/home/ghoogewerf/GccBuild/build/tic6x-none-elf-newlib/tools/i686-pc-linux-gnu/tic6x-none-elf --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=tic6x-none-elf --enable-languages=c,c++ --disable-libssp --disable-wchar_t --disable-multilib --with-pkgversion='Test G++ 7.2.0-p3' --disable-nls --disable-fixed-point --disable-decimal-float --with-arch=c64x+ --disable-lto --with-newlib --with-headers=/home/ghoogewerf/GccBuild/src/newlib/newlib/libc/include Thread model: single gcc version 7.2.0 (Test G++ 7.2.0-p3) COLLECT_GCC_OPTIONS='-c' '-O2' '-Wall' '-Wextra' '-march=c64x+' '-v' '-save-temps' /home/ghoogewerf/GccBuild/build/tic6x-none-elf-newlib/tools/i686-pc-linux-gnu/tic6x-none-elf/libexec/gcc/tic6x-none-elf/7.2.0/cc1 -E -quiet -v pack.c -march=c64x+ -Wall -Wextra -O2 -fpch-preprocess -o pack.i #include "..." search starts here: #include <...> search starts here: /home/ghoogewerf/GccBuild/build/tic6x-none-elf-newlib/tools/i686-pc-linux-gnu/tic6x-none-elf/lib/gcc/tic6x-none-elf/7.2.0/include /home/ghoogewerf/GccBuild/build/tic6x-none-elf-newlib/tools/i686-pc-linux-gnu/tic6x-none-elf/lib/gcc/tic6x-none-elf/7.2.0/include-fixed /home/ghoogewerf/GccBuild/build/tic6x-none-elf-newlib/tools/i686-pc-linux-gnu/tic6x-none-elf/lib/gcc/tic6x-none-elf/7.2.0/../../../../tic6x-none-elf/sys-include /home/ghoogewerf/GccBuild/build/tic6x-none-elf-newlib/tools/i686-pc-linux-gnu/tic6x-none-elf/lib/gcc/tic6x-none-elf/7.2.0/../../../../tic6x-none-elf/include End of search list. COLLECT_GCC_OPTIONS='-c' '-O2' '-Wall' '-Wextra' '-march=c64x+' '-v' '-save-temps' /home/ghoogewerf/GccBuild/build/tic6x-none-elf-newlib/tools/i686-pc-linux-gnu/tic6x-none-elf/libexec/gcc/tic6x-none-elf/7.2.0/cc1 -fpreprocessed pack.i -quiet -dumpbase pack.c -march=c64x+ -auxbase pack -O2 -Wall -Wextra -version -o pack.s GNU C11 (Test G++ 7.2.0-p3) version 7.2.0 (tic6x-none-elf) compiled by GNU C version 4.9.4, GMP version 6.1.0, MPFR version 3.1.3, MPC version 1.0.3, isl version none GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 GNU C11 (Test G++ 7.2.0-p3) version 7.2.0 (tic6x-none-elf) compiled by GNU C version 4.9.4, GMP version 6.1.0, MPFR version 3.1.3, MPC version 1.0.3, isl version none GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: f86a3322b854da36fc325771f0c6992e COLLECT_GCC_OPTIONS='-c' '-O2' '-Wall' '-Wextra' '-march=c64x+' '-v' '-save-temps' /home/ghoogewerf/GccBuild/build/tic6x-none-elf-newlib/tools/i686-pc-linux-gnu/tic6x-none-elf/lib/gcc/tic6x-none-elf/7.2.0/../../../../tic6x-none-elf/bin/as -march=c64x+ -o pack.o pack.s pack.s: Assembler messages: pack.s:15: Error: operand 1 of 'pack2' on wrong side Thanks, G. Hoogewerf