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

--- Comment #9 from Jan André Reuter <j.reu...@fz-juelich.de> ---
Thanks a lot for the patch Prathamesh Kulkarni. There seems to be some
progress, which is great to see!

I've tried your patch. I applied it to the latest snapshot and also to GCC
14.2.0 and GCC 14.1.0 to see what happens. In general, all three versions seem
to come a bit further towards getting offloading to work. The GCC 15 snapshot
seems closest, but now fails with an unknown argument error. In all cases, I
built GCC with the EasyBlock of Easybuild, though I'm not sure if that's the
cause why the flag is here.

GCC 14.2.0 (built with EasyBuild, applied patch):
====

```console
$ gcc -fopenmp -foffload=nvptx-none test.c
lto1: internal compiler error: in lto_read_decls, at lto/lto-common.cc:1970
0x68110f lto_read_decls
        ../.././gcc/lto/lto-common.cc:1970
0x68110f lto_file_finalize
        ../.././gcc/lto/lto-common.cc:2292
0x68110f lto_create_files_from_ids
        ../.././gcc/lto/lto-common.cc:2302
0x68110f lto_file_read
        ../.././gcc/lto/lto-common.cc:2357
0x68110f read_cgraph_and_symbols(unsigned int, char const**)
        ../.././gcc/lto/lto-common.cc:2805
0x66b13f lto_main()
        ../.././gcc/lto/lto.cc:656
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
nvptx mkoffload: fatal error: aarch64-unknown-linux-gnu-accel-nvptx-none-gcc
returned 1 exit status
compilation terminated.
lto-wrapper: fatal error:
/p/usersoftware/cstpa/reuter1/EasyBuild/easybuild/jedi/software/GCCcore/14.2.0/libexec/gcc/aarch64-unknown-linux-gnu/14.2.0//accel/nvptx-none/mkoffload
returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
```

---

GCC 14.1.0 (built with EasyBuild, applied patch):
====

```console
$ gcc -fopenmp -foffload=nvptx-none test.c
lto1: internal compiler error: in lto_read_decls, at lto/lto-common.cc:1970
0x680eaf lto_read_decls
        ../.././gcc/lto/lto-common.cc:1970
0x680eaf lto_file_finalize
        ../.././gcc/lto/lto-common.cc:2292
0x680eaf lto_create_files_from_ids
        ../.././gcc/lto/lto-common.cc:2302
0x680eaf lto_file_read
        ../.././gcc/lto/lto-common.cc:2357
0x680eaf read_cgraph_and_symbols(unsigned int, char const**)
        ../.././gcc/lto/lto-common.cc:2805
0x66aebf lto_main()
        ../.././gcc/lto/lto.cc:656
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
nvptx mkoffload: fatal error: aarch64-unknown-linux-gnu-accel-nvptx-none-gcc
returned 1 exit status
compilation terminated.
lto-wrapper: fatal error:
/p/usersoftware/cstpa/reuter1/EasyBuild/easybuild/jedi/software/GCCcore/14.1.0/libexec/gcc/aarch64-unknown-linux-gnu/14.1.0//accel/nvptx-none/mkoffload
returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

```

Execution no longer segmentation faults, but compilation still fails in LTO. No
changes from 14.1.0 to 14.2.0.

---

GCC 15.0.0 (gcc-15-20240804, built with EasyBuild using adapted GCC 14.2.0
EasyConfig and the patch applied):
====

```console
$ gcc -fopenmp -foffload=nvptx-none test.c
gcc: error: unrecognized command-line option ‘-m64’
nvptx mkoffload: fatal error: gcc returned 1 exit status
compilation terminated.
lto-wrapper: fatal error:
/p/usersoftware/cstpa/reuter1/EasyBuild/easybuild/jedi/software/GCCcore/15.0.0/libexec/gcc/aarch64-unknown-linux-gnu/15.0.0//accel/nvptx-none/mkoffload
returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
$ gcc --version
gcc (GCC) 15.0.0 20240804 (experimental)
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```

Reply via email to