https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119767

            Bug ID: 119767
           Summary: libgccjit fails on sparc
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: testsuite-fail, wrong-code
          Severity: normal
          Priority: P3
         Component: jit
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
                CC: antoyo at gcc dot gnu.org
  Target Milestone: ---
            Target: sparc64-unknown-linux-gnu

emacs' native-compilation fails to build (https://bugs.gentoo.org/953775) on
sparc64-unknown-linux-gnu with a bunch of SIGSEGV and SIGBUS:
```
```
/var/tmp/portage/app-editors/emacs-30.1-r1/work/emacs-30.1/lisp $ gdb --args
'../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp --eval "(setq
load-prefer-newer t byte-compile-warnings 'all)" --eval "(setq
org--inhibit-version-check t)"          -l comp -f
byte-compile-refresh-preloaded         -f batch-byte+native-compile
../lisp/term/android-win.el
[...]
Starting program:
/var/tmp/portage/app-editors/emacs-30.1-r1/work/emacs-30.1/src/bootstrap-emacs
-batch --no-site-file --no-site-lisp --eval \(setq\ load-prefer-newer\ t\
byte-compile-warnings\ \'all\) --eval \(setq\ org--inhibit-version-check\ t\)
-l comp -f byte-compile-refresh-preloaded -f batch-byte+native-compile
../lisp/term/android-win.el
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib64/libthread_db.so.1".

Program received signal SIGBUS, Bus error.
0xfff8000116792b88 in top_level_run () from
/var/tmp/portage/app-editors/emacs-30.1-r1/work/emacs-30.1/native-lisp/30.1-b9aa27ce/comp-7672a6ed-a60aebab.eln
(gdb) bt
#0  0xfff8000116792b88 in top_level_run () from
/var/tmp/portage/app-editors/emacs-30.1-r1/work/emacs-30.1/native-lisp/30.1-b9aa27ce/comp-7672a6ed-a60aebab.eln
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
```

Turning to the libgccjit testsuite on trunk, I see many failures:
```
$ ~/gcc/configure --enable-host-shared --enable-languages=c,c++,jit
--disable-bootstrap --disable-multilib --host=sparc64-unknown-linux-gnu
--build=sparc64-unknown-linux-gnu
$ make check-jit
FAIL: tut01-hello-world.c.exe killed: SIGSEGV segmentation violation
FAIL: tut01-hello-world.cc.exe killed: SIGSEGV segmentation violation
FAIL: emit-alphabet.bf.exe execution test
FAIL: test-array-as-pointer.c.exe killed: SIGSEGV segmentation violation
FAIL: test-arrays.c.exe killed: SIGSEGV segmentation violation
FAIL: test-calling-external-function.c.exe killed: SIGSEGV segmentation
violation
FAIL: jit.dg/test-combination.c, initial compilation
FAIL: output-of-test-compile-to-assembler.c.s.exe execution test
FAIL: verify-dynamic-library.c.exe execution test
FAIL: output-of-test-compile-to-executable.c.exe execution test
FAIL: output-of-test-compile-to-object.c.o.exe execution test
FAIL: test-constants.c.exe killed: SIGSEGV segmentation violation
FAIL: test-dot-product.c.exe killed: SIGSEGV segmentation violation
FAIL: test-error-impossible-must-tail-call.c.exe iteration 1 of 5: verify_code:
actual: "cannot tail-call: memory reference or volatile after call" !=
expected: "cannot tail-call: callee returns a structure"
FAIL: test-error-impossible-must-tail-call.c.exe killed: SIGABRT SIGABRT
FAIL: test-error-register-variable-size-mismatch.c.exe iteration 1 of 5:
verify_code: actual: "invalid register name for 'global_variable'" != expected:
"data type of 'global_variable' isn't suitable for a register"
FAIL: test-error-register-variable-size-mismatch.c.exe killed: SIGABRT SIGABRT
FAIL: test-expressions.c.exe killed: SIGSEGV segmentation violation
FAIL: test-extra-options.c.exe killed: SIGSEGV segmentation violation
FAIL: test-functions.c.exe killed: SIGILL illegal instruction
FAIL: test-global-init-rvalue.c.exe killed: SIGSEGV segmentation violation
FAIL: test-hello-world.c.exe killed: SIGILL illegal instruction
FAIL: test-local-init-rvalue.c.exe killed: SIGSEGV segmentation violation
FAIL: test-long-string-literal.c.exe iteration 1 of 5: verify_code: actual:
strcmp (str, very_long_string) != expected: 0
FAIL: test-long-string-literal.c.exe killed: SIGABRT SIGABRT
FAIL: test-nested-contexts.c.exe killed: SIGSEGV segmentation violation
FAIL: did not find a generated reproducer:
test-nested-contexts.c.exe.reproducer.c
FAIL: test-nested-loops.c.exe killed: SIGSEGV segmentation violation
FAIL: test-operator-overloading.cc.exe killed: SIGSEGV segmentation violation
FAIL: test-pr117886-write-reproducer.c.exe killed: SIGBUS bus error
FAIL: test-pr66700-observing-write-through-ptr.c.exe killed: SIGSEGV
segmentation violation
FAIL: test-quadratic.c.exe killed: SIGSEGV segmentation violation
FAIL: test-quadratic.cc.exe killed: SIGSEGV segmentation violation
FAIL: test-returning-function-ptr.c.exe killed: SIGBUS bus error
FAIL: test-string-literal.c.exe iteration 1 of 5: verify_code: actual: strcmp
(str, "hello world") != expected: 0
FAIL: test-string-literal.c.exe killed: SIGABRT SIGABRT
FAIL: jit.dg/test-threads.c, initial compilation
FAIL: test-tls.c.exe killed: SIGBUS bus error
FAIL: jit.dg/test-types.c, initial compilation
FAIL: test-using-global.c.exe killed: SIGBUS bus error

                === jit Summary ===

# of expected passes            5474
# of unexpected failures        40
# of unsupported tests          22
```

```
$ /tmp/build/gcc/xgcc -v
Using built-in specs.
COLLECT_GCC=/tmp/build/gcc/xgcc
Target: sparc64-unknown-linux-gnu
Configured with: /root/gcc/configure --enable-host-shared
--enable-languages=c,c++,jit --disable-bootstrap --disable-multilib
--host=sparc64-unknown-linux-gnu --build=sparc64-unknown-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.1 20250413 (experimental) (GCC)
```

Reply via email to