https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83143
Bug ID: 83143 Summary: [SH]: Assembler messages: invalid operands (*UND* and .text sections) for `-' Product: gcc Version: 7.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: glaubitz at physik dot fu-berlin.de Target Milestone: --- Created attachment 42706 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42706&action=edit C source code file which causes the miscompiled code Trying to build mesa on Debian unstable (sh4) with gcc-7.2.0 fails with: (sid-sh4-sbuild)root@nofan:/build/mesa-D7X6g9/mesa-17.2.4/build# make /bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) Making all in src make[1]: Entering directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src' /bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) /bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) updating git_sha1.h /bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) /usr/bin/make all-recursive /bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) make[2]: Entering directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src' /bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) Making all in . make[3]: Entering directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src' make[3]: Nothing to be done for 'all-am'. make[3]: Leaving directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src' Making all in gtest make[3]: Entering directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src/gtest' make[3]: Nothing to be done for 'all'. make[3]: Leaving directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src/gtest' Making all in util make[3]: Entering directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src/util' /usr/bin/make all-recursive /bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) make[4]: Entering directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src/util' /bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) Making all in . make[5]: Entering directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src/util' make[5]: Nothing to be done for 'all-am'. make[5]: Leaving directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src/util' Making all in tests/hash_table make[5]: Entering directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src/util/tests/hash_table' make[5]: Nothing to be done for 'all'. make[5]: Leaving directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src/util/tests/hash_table' make[4]: Leaving directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src/util' make[3]: Leaving directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src/util' Making all in mapi/glapi/gen make[3]: Entering directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src/mapi/glapi/gen' /usr/bin/make all-am /bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) make[4]: Entering directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src/mapi/glapi/gen' make[4]: Nothing to be done for 'all-am'. make[4]: Leaving directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src/mapi/glapi/gen' make[3]: Leaving directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src/mapi/glapi/gen' Making all in mapi make[3]: Entering directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src/mapi' /usr/bin/make all-recursive /bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) make[4]: Entering directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src/mapi' /bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) make[5]: Entering directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src/mapi' make[5]: Nothing to be done for 'all-am'. make[5]: Leaving directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src/mapi' make[4]: Leaving directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src/mapi' make[3]: Leaving directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src/mapi' Making all in compiler make[3]: Entering directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src/compiler' /usr/bin/make all-am /bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) make[4]: Entering directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src/compiler' /bin/bash ../../libtool --tag=CC --mode=compile gcc -DPACKAGE_NAME=\"Mesa\" -DPACKAGE_TARNAME=\"mesa\" -DPACKAGE_VERSION=\"17.2.4\" -DPACKAGE_STRING=\"Mesa\ 17.2.4\" -DPACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi\?product=Mesa\" -DPACKAGE_URL=\"\" -DPACKAGE=\"mesa\" -DVERSION=\"17.2.4\" -D_FILE_OFFSET_BITS=64 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE___BUILTIN_BSWAP32=1 -DHAVE___BUILTIN_BSWAP64=1 -DHAVE___BUILTIN_CLZ=1 -DHAVE___BUILTIN_CLZLL=1 -DHAVE___BUILTIN_CTZ=1 -DHAVE___BUILTIN_EXPECT=1 -DHAVE___BUILTIN_FFS=1 -DHAVE___BUILTIN_FFSLL=1 -DHAVE___BUILTIN_POPCOUNT=1 -DHAVE___BUILTIN_POPCOUNTLL=1 -DHAVE___BUILTIN_UNREACHABLE=1 -DHAVE_FUNC_ATTRIBUTE_CONST=1 -DHAVE_FUNC_ATTRIBUTE_FLATTEN=1 -DHAVE_FUNC_ATTRIBUTE_FORMAT=1 -DHAVE_FUNC_ATTRIBUTE_MALLOC=1 -DHAVE_FUNC_ATTRIBUTE_PACKED=1 -DHAVE_FUNC_ATTRIBUTE_PURE=1 -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL=1 -DHAVE_FUNC_ATTRIBUTE_UNUSED=1 -DHAVE_FUNC_ATTRIBUTE_VISIBILITY=1 -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT=1 -DHAVE_FUNC_ATTRIBUTE_WEAK=1 -DHAVE_FUNC_ATTRIBUTE_ALIAS=1 -DMAJOR_IN_SYSMACROS=1 -DHAVE_DLADDR=1 -DHAVE_CLOCK_GETTIME=1 -DHAVE_PTHREAD=1 -I. -I../../../src/compiler -I../../../include -I../../../src -I../../../src/mapi -I../../../src/mesa/ -I../../src/compiler/glsl -I../../../src/compiler/glsl -I../../../src/compiler/glsl/glcpp -I../../src/compiler/nir -I../../../src/compiler/nir -I../../../src/compiler/spirv -I../../../src/gallium/include -I../../../src/gallium/auxiliary -I../../../src/gtest/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D_GNU_SOURCE -DUSE_GCC_ATOMIC_BUILTINS -DMISSING_64BIT_ATOMICS -DNDEBUG -DTEXTURE_FLOAT_ENABLED -DHAVE_XLOCALE_H -DHAVE_SYS_SYSCTL_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_STRTOD_L -DHAVE_DLOPEN -DHAVE_DL_ITERATE_PHDR -DHAVE_POSIX_MEMALIGN -DHAVE_GALLIUM_EXTRA_HUD=1 -DHAVE_LIBSENSORS=1 -DUSE_LIBGLVND=1 -DHAVE_LIBDRM -DGLX_USE_DRM -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_TLS -DHAVE_X11_PLATFORM -DHAVE_SURFACELESS_PLATFORM -DHAVE_WAYLAND_PLATFORM -DHAVE_DRM_PLATFORM -DHAVE_DRI3 -DENABLE_SHADER_CACHE -DHAVE_MINCORE -DHAVE_ST_VDPAU -Wdate-time -D_FORTIFY_SOURCE=2 -fvisibility=hidden -Werror=pointer-arith -Werror=vla -g -O2 -fdebug-prefix-map=/build/mesa-D7X6g9/mesa-17.2.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wall -std=c99 -Werror=implicit-function-declaration -Werror=missing-prototypes -fno-math-errno -fno-trapping-math -c -o nir/nir_lower_int64.lo ../../../src/compiler/nir/nir_lower_int64.c /bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) /bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) libtool: compile: gcc -DPACKAGE_NAME=\"Mesa\" -DPACKAGE_TARNAME=\"mesa\" -DPACKAGE_VERSION=\"17.2.4\" "-DPACKAGE_STRING=\"Mesa 17.2.4\"" "-DPACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\"" -DPACKAGE_URL=\"\" -DPACKAGE=\"mesa\" -DVERSION=\"17.2.4\" -D_FILE_OFFSET_BITS=64 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE___BUILTIN_BSWAP32=1 -DHAVE___BUILTIN_BSWAP64=1 -DHAVE___BUILTIN_CLZ=1 -DHAVE___BUILTIN_CLZLL=1 -DHAVE___BUILTIN_CTZ=1 -DHAVE___BUILTIN_EXPECT=1 -DHAVE___BUILTIN_FFS=1 -DHAVE___BUILTIN_FFSLL=1 -DHAVE___BUILTIN_POPCOUNT=1 -DHAVE___BUILTIN_POPCOUNTLL=1 -DHAVE___BUILTIN_UNREACHABLE=1 -DHAVE_FUNC_ATTRIBUTE_CONST=1 -DHAVE_FUNC_ATTRIBUTE_FLATTEN=1 -DHAVE_FUNC_ATTRIBUTE_FORMAT=1 -DHAVE_FUNC_ATTRIBUTE_MALLOC=1 -DHAVE_FUNC_ATTRIBUTE_PACKED=1 -DHAVE_FUNC_ATTRIBUTE_PURE=1 -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL=1 -DHAVE_FUNC_ATTRIBUTE_UNUSED=1 -DHAVE_FUNC_ATTRIBUTE_VISIBILITY=1 -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT=1 -DHAVE_FUNC_ATTRIBUTE_WEAK=1 -DHAVE_FUNC_ATTRIBUTE_ALIAS=1 -DMAJOR_IN_SYSMACROS=1 -DHAVE_DLADDR=1 -DHAVE_CLOCK_GETTIME=1 -DHAVE_PTHREAD=1 -I. -I../../../src/compiler -I../../../include -I../../../src -I../../../src/mapi -I../../../src/mesa/ -I../../src/compiler/glsl -I../../../src/compiler/glsl -I../../../src/compiler/glsl/glcpp -I../../src/compiler/nir -I../../../src/compiler/nir -I../../../src/compiler/spirv -I../../../src/gallium/include -I../../../src/gallium/auxiliary -I../../../src/gtest/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D_GNU_SOURCE -DUSE_GCC_ATOMIC_BUILTINS -DMISSING_64BIT_ATOMICS -DNDEBUG -DTEXTURE_FLOAT_ENABLED -DHAVE_XLOCALE_H -DHAVE_SYS_SYSCTL_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_STRTOD_L -DHAVE_DLOPEN -DHAVE_DL_ITERATE_PHDR -DHAVE_POSIX_MEMALIGN -DHAVE_GALLIUM_EXTRA_HUD=1 -DHAVE_LIBSENSORS=1 -DUSE_LIBGLVND=1 -DHAVE_LIBDRM -DGLX_USE_DRM -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_TLS -DHAVE_X11_PLATFORM -DHAVE_SURFACELESS_PLATFORM -DHAVE_WAYLAND_PLATFORM -DHAVE_DRM_PLATFORM -DHAVE_DRI3 -DENABLE_SHADER_CACHE -DHAVE_MINCORE -DHAVE_ST_VDPAU -Wdate-time -D_FORTIFY_SOURCE=2 -fvisibility=hidden -Werror=pointer-arith -Werror=vla -g -O2 -fdebug-prefix-map=/build/mesa-D7X6g9/mesa-17.2.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wall -std=c99 -Werror=implicit-function-declaration -Werror=missing-prototypes -fno-math-errno -fno-trapping-math -c ../../../src/compiler/nir/nir_lower_int64.c -fPIC -DPIC -o nir/.libs/nir_lower_int64.o ../../libtool: line 1761: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) /tmp/cciuynF1.s: Assembler messages: /tmp/cciuynF1.s:19366: Error: invalid operands (*UND* and .text sections) for `-' /tmp/cciuynF1.s:21831: Error: invalid operands (*UND* and .text sections) for `-' /tmp/cciuynF1.s:23865: Error: invalid operands (*UND* and .text sections) for `-' /tmp/cciuynF1.s:27010: Error: invalid operands (*UND* and .text sections) for `-' Makefile:2395: recipe for target 'nir/nir_lower_int64.lo' failed make[4]: *** [nir/nir_lower_int64.lo] Error 1 make[4]: Leaving directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src/compiler' Makefile:1555: recipe for target 'all' failed make[3]: *** [all] Error 2 make[3]: Leaving directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src/compiler' Makefile:855: recipe for target 'all-recursive' failed make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src' Makefile:646: recipe for target 'all' failed make[1]: *** [all] Error 2 make[1]: Leaving directory '/build/mesa-D7X6g9/mesa-17.2.4/build/src' Makefile:652: recipe for target 'all-recursive' failed make: *** [all-recursive] Error 1 (sid-sh4-sbuild)root@nofan:/build/mesa-D7X6g9/mesa-17.2.4/build# Attaching the source code file as well as all generated files (*.s, *.i and *.o).