public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/115608] New: ICE in extract_insn, at recog.cc:2812 when building with -mv8plus
@ 2024-06-24  6:40 glaubitz at physik dot fu-berlin.de
  2024-06-24  6:47 ` [Bug target/115608] " pinskia at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: glaubitz at physik dot fu-berlin.de @ 2024-06-24  6:40 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115608
           Summary: ICE in extract_insn, at recog.cc:2812 when building
                    with -mv8plus
           Product: gcc
           Version: 14.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: glaubitz at physik dot fu-berlin.de
                CC: ebotcazou at gcc dot gnu.org, jrtc27 at jrtc27 dot com,
                    matorola at gmail dot com, sjames at gcc dot gnu.org
  Target Milestone: ---
            Target: sparc-linux-gnu

Support for the V8+ API seems to be broken in GCC as even trying to build a
simple program with "-mv8plus" fails:

(sid_sparc64-dchroot)glaubitz@stadler:~$ cat hello.c
#include <stdio.h>

int main () {
  printf("Hello World!");
  return 0;
}
(sid_sparc64-dchroot)glaubitz@stadler:~$ gcc-14 -mv8plus hello.c -o hello
hello.c: In function 'main':
hello.c:6:1: error: unrecognizable insn:
    6 | }
      | ^
(insn 6 5 7 2 (set (reg:DI 115)
        (lo_sum:DI (reg:DI 115)
            (unspec:DI [
                    (symbol_ref/f:SI ("*.LC0") [flags 0x2] <var_decl
0xfff8000101c305a0 *.LC0>)
                ] UNSPEC_MOVE_PIC))) "hello.c":4:3 -1
     (nil))
during RTL pass: vregs
hello.c:6:1: internal compiler error: in extract_insn, at recog.cc:2812
0x4d60a7 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        ../../src/gcc/rtl-error.cc:108
0x4d60d7 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        ../../src/gcc/rtl-error.cc:116
0xb3b21b extract_insn(rtx_insn*)
        ../../src/gcc/recog.cc:2812
0x9e29eb instantiate_virtual_regs_in_insn
        ../../src/gcc/function.cc:1612
0x9e29eb instantiate_virtual_regs
        ../../src/gcc/function.cc:1995
0x9e29eb execute
        ../../src/gcc/function.cc:2042
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-14/README.Bugs> for instructions.
(sid_sparc64-dchroot)glaubitz@stadler:~$

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/115608] ICE in extract_insn, at recog.cc:2812 when building with -mv8plus
  2024-06-24  6:40 [Bug target/115608] New: ICE in extract_insn, at recog.cc:2812 when building with -mv8plus glaubitz at physik dot fu-berlin.de
@ 2024-06-24  6:47 ` pinskia at gcc dot gnu.org
  2024-06-24  6:51 ` pinskia at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-24  6:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note -fPIE is needed to get the ICE in this case.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/115608] ICE in extract_insn, at recog.cc:2812 when building with -mv8plus
  2024-06-24  6:40 [Bug target/115608] New: ICE in extract_insn, at recog.cc:2812 when building with -mv8plus glaubitz at physik dot fu-berlin.de
  2024-06-24  6:47 ` [Bug target/115608] " pinskia at gcc dot gnu.org
@ 2024-06-24  6:51 ` pinskia at gcc dot gnu.org
  2024-06-24  7:56 ` ebotcazou at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-24  6:51 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|sparc-linux-gnu             |sparc64-linux-gnu

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
  /* V8PLUS requires V9 and makes no sense in 64-bit mode.  */
  if (!TARGET_V9 || TARGET_ARCH64)
    target_flags &= ~MASK_V8PLUS;


Basically for sparc64, -mv8plus should have been a no-op ...

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/115608] ICE in extract_insn, at recog.cc:2812 when building with -mv8plus
  2024-06-24  6:40 [Bug target/115608] New: ICE in extract_insn, at recog.cc:2812 when building with -mv8plus glaubitz at physik dot fu-berlin.de
  2024-06-24  6:47 ` [Bug target/115608] " pinskia at gcc dot gnu.org
  2024-06-24  6:51 ` pinskia at gcc dot gnu.org
@ 2024-06-24  7:56 ` ebotcazou at gcc dot gnu.org
  2024-06-24 10:16 ` glaubitz at physik dot fu-berlin.de
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2024-06-24  7:56 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-06-24
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |WAITING

--- Comment #3 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
You always need to specify how the compiler has been configured.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/115608] ICE in extract_insn, at recog.cc:2812 when building with -mv8plus
  2024-06-24  6:40 [Bug target/115608] New: ICE in extract_insn, at recog.cc:2812 when building with -mv8plus glaubitz at physik dot fu-berlin.de
                   ` (2 preceding siblings ...)
  2024-06-24  7:56 ` ebotcazou at gcc dot gnu.org
@ 2024-06-24 10:16 ` glaubitz at physik dot fu-berlin.de
  2024-06-24 16:49 ` ebotcazou at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: glaubitz at physik dot fu-berlin.de @ 2024-06-24 10:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin.de> ---
(In reply to Eric Botcazou from comment #3)
> You always need to specify how the compiler has been configured.

Here you go:

(sid_sparc64-dchroot)glaubitz@stadler:~$ gcc-14 -v
Using built-in specs.
COLLECT_GCC=gcc-14
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/sparc64-linux-gnu/14/lto-wrapper
Target: sparc64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 14.1.0-2'
--with-bugurl=file:///usr/share/doc/gcc-14/README.Bugs
--enable-languages=c,ada,c++,go,fortran,objc,obj-c++,m2,rust --prefix=/usr
--with-gcc-major-version-only --program-suffix=-14
--program-prefix=sparc64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/libexec --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-libstdcxx-backtrace
--enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support
--enable-plugin --enable-default-pie --with-system-zlib --enable-objc-gc=auto
--enable-multiarch --disable-werror --with-cpu-32=ultrasparc
--enable-targets=all --with-long-double-128 --enable-multilib
--enable-checking=release --build=sparc64-linux-gnu --host=sparc64-linux-gnu
--target=sparc64-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.1.0 (Debian 14.1.0-2) 
(sid_sparc64-dchroot)glaubitz@stadler:~$

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/115608] ICE in extract_insn, at recog.cc:2812 when building with -mv8plus
  2024-06-24  6:40 [Bug target/115608] New: ICE in extract_insn, at recog.cc:2812 when building with -mv8plus glaubitz at physik dot fu-berlin.de
                   ` (3 preceding siblings ...)
  2024-06-24 10:16 ` glaubitz at physik dot fu-berlin.de
@ 2024-06-24 16:49 ` ebotcazou at gcc dot gnu.org
  2024-06-24 16:51 ` glaubitz at physik dot fu-berlin.de
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2024-06-24 16:49 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW

--- Comment #5 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Tentative fix:

diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
index 1e2e4aef2ad..83e0d6874d9 100644
--- a/gcc/config/sparc/linux64.h
+++ b/gcc/config/sparc/linux64.h
@@ -162,7 +162,7 @@ extern const char *host_detect_local_cpu (int argc, const
char **argv);
 "%{m32:%{m64:%emay not use both -m32 and -m64}} \
 %{m32:-mptr32 -mno-stack-bias %{!mlong-double-128:-mlong-double-64} \
   %{!mcpu*:-mcpu=cypress}} \
-%{mv8plus:-mptr32 -mno-stack-bias %{!mlong-double-128:-mlong-double-64} \
+%{mv8plus:-m32 -mptr32 -mno-stack-bias %{!mlong-double-128:-mlong-double-64} \
   %{!mcpu*:-mcpu=v9}} \
 %{!m32:%{!mcpu*:-mcpu=ultrasparc}} \
 %{!mno-vis:%{!m32:%{!mcpu=v9:-mvis}}}"

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/115608] ICE in extract_insn, at recog.cc:2812 when building with -mv8plus
  2024-06-24  6:40 [Bug target/115608] New: ICE in extract_insn, at recog.cc:2812 when building with -mv8plus glaubitz at physik dot fu-berlin.de
                   ` (4 preceding siblings ...)
  2024-06-24 16:49 ` ebotcazou at gcc dot gnu.org
@ 2024-06-24 16:51 ` glaubitz at physik dot fu-berlin.de
  2024-06-24 17:02 ` ebotcazou at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: glaubitz at physik dot fu-berlin.de @ 2024-06-24 16:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin.de> ---
(In reply to Eric Botcazou from comment #5)
> Tentative fix:
> 
> diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
> index 1e2e4aef2ad..83e0d6874d9 100644
> --- a/gcc/config/sparc/linux64.h
> +++ b/gcc/config/sparc/linux64.h
> @@ -162,7 +162,7 @@ extern const char *host_detect_local_cpu (int argc,
> const char **argv);
>  "%{m32:%{m64:%emay not use both -m32 and -m64}} \
>  %{m32:-mptr32 -mno-stack-bias %{!mlong-double-128:-mlong-double-64} \
>    %{!mcpu*:-mcpu=cypress}} \
> -%{mv8plus:-mptr32 -mno-stack-bias %{!mlong-double-128:-mlong-double-64} \
> +%{mv8plus:-m32 -mptr32 -mno-stack-bias
> %{!mlong-double-128:-mlong-double-64} \
>    %{!mcpu*:-mcpu=v9}} \
>  %{!m32:%{!mcpu*:-mcpu=ultrasparc}} \
>  %{!mno-vis:%{!m32:%{!mcpu=v9:-mvis}}}"

Indeed, passing -m32 on the command line as well fixes the problem.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/115608] ICE in extract_insn, at recog.cc:2812 when building with -mv8plus
  2024-06-24  6:40 [Bug target/115608] New: ICE in extract_insn, at recog.cc:2812 when building with -mv8plus glaubitz at physik dot fu-berlin.de
                   ` (5 preceding siblings ...)
  2024-06-24 16:51 ` glaubitz at physik dot fu-berlin.de
@ 2024-06-24 17:02 ` ebotcazou at gcc dot gnu.org
  2024-06-25  9:50 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2024-06-24 17:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Right, but Solaris does it automatically so Linux can probably mimic it.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/115608] ICE in extract_insn, at recog.cc:2812 when building with -mv8plus
  2024-06-24  6:40 [Bug target/115608] New: ICE in extract_insn, at recog.cc:2812 when building with -mv8plus glaubitz at physik dot fu-berlin.de
                   ` (6 preceding siblings ...)
  2024-06-24 17:02 ` ebotcazou at gcc dot gnu.org
@ 2024-06-25  9:50 ` cvs-commit at gcc dot gnu.org
  2024-06-25  9:50 ` cvs-commit at gcc dot gnu.org
  2024-06-25  9:52 ` ebotcazou at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-06-25  9:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Eric Botcazou <ebotcazou@gcc.gnu.org>:

https://gcc.gnu.org/g:d4db77ce37a65207baea88859fd9c191469187f8

commit r15-1608-gd4db77ce37a65207baea88859fd9c191469187f8
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Tue Jun 25 11:47:48 2024 +0200

    SPARC: fix internal error with -mv8plus on 64-bit Linux

    This passes -m32 when -mv8plus is specified on Linux (like on Solaris).

    gcc/
            PR target/115608
            * config/sparc/linux64.h (CC1_SPEC): Pass -m32 for -mv8plus.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/115608] ICE in extract_insn, at recog.cc:2812 when building with -mv8plus
  2024-06-24  6:40 [Bug target/115608] New: ICE in extract_insn, at recog.cc:2812 when building with -mv8plus glaubitz at physik dot fu-berlin.de
                   ` (7 preceding siblings ...)
  2024-06-25  9:50 ` cvs-commit at gcc dot gnu.org
@ 2024-06-25  9:50 ` cvs-commit at gcc dot gnu.org
  2024-06-25  9:52 ` ebotcazou at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-06-25  9:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Eric Botcazou
<ebotcazou@gcc.gnu.org>:

https://gcc.gnu.org/g:4bf93fc3d360dbeb5c07303c1b5028989c575ac1

commit r14-10345-g4bf93fc3d360dbeb5c07303c1b5028989c575ac1
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Tue Jun 25 11:47:48 2024 +0200

    SPARC: fix internal error with -mv8plus on 64-bit Linux

    This passes -m32 when -mv8plus is specified on Linux (like on Solaris).

    gcc/
            PR target/115608
            * config/sparc/linux64.h (CC1_SPEC): Pass -m32 for -mv8plus.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/115608] ICE in extract_insn, at recog.cc:2812 when building with -mv8plus
  2024-06-24  6:40 [Bug target/115608] New: ICE in extract_insn, at recog.cc:2812 when building with -mv8plus glaubitz at physik dot fu-berlin.de
                   ` (8 preceding siblings ...)
  2024-06-25  9:50 ` cvs-commit at gcc dot gnu.org
@ 2024-06-25  9:52 ` ebotcazou at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2024-06-25  9:52 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.2
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #10 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Probably 20 years too late, but thanks for reporting the problem. ;-)

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-06-25  9:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-24  6:40 [Bug target/115608] New: ICE in extract_insn, at recog.cc:2812 when building with -mv8plus glaubitz at physik dot fu-berlin.de
2024-06-24  6:47 ` [Bug target/115608] " pinskia at gcc dot gnu.org
2024-06-24  6:51 ` pinskia at gcc dot gnu.org
2024-06-24  7:56 ` ebotcazou at gcc dot gnu.org
2024-06-24 10:16 ` glaubitz at physik dot fu-berlin.de
2024-06-24 16:49 ` ebotcazou at gcc dot gnu.org
2024-06-24 16:51 ` glaubitz at physik dot fu-berlin.de
2024-06-24 17:02 ` ebotcazou at gcc dot gnu.org
2024-06-25  9:50 ` cvs-commit at gcc dot gnu.org
2024-06-25  9:50 ` cvs-commit at gcc dot gnu.org
2024-06-25  9:52 ` ebotcazou at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).