public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/110934] New: m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2
@ 2023-08-07 11:33 wbx at openadk dot org
  2023-08-07 12:03 ` [Bug rtl-optimization/110934] " rguenth at gcc dot gnu.org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: wbx at openadk dot org @ 2023-08-07 11:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110934
           Summary: m68k: ICE with -fzero-call-used-regs=all compiling
                    openssh 9.3p2
           Product: gcc
           Version: 13.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: wbx at openadk dot org
  Target Milestone: ---

Hi,

following ICE is generated when using Buildroot to compile OpenSSH 9.3p2 for
m68k.

 /home/browa22-ext/openssh/output/host/bin/m68k-buildroot-linux-uclibc-gcc
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os -g0 
-pipe -Wno-error=format-truncation -Wall -Wpointer-arith -Wuninitialized
-Wsign-compare -Wformat-security -Wsizeof-pointer-memaccess -Wno-pointer-sign
-Wno-unused-result -Wimplicit-fallthrough -Wmisleading-indentation
-fno-strict-aliasing -D_FORTIFY_SOURCE=2 -ftrapv -fzero-call-used-regs=all
-ftrivial-auto-var-init=zero -fno-builtin-memset   -fPIC -I. -I.. -I. -I./..
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_GNU_SOURCE
-DHAVE_CONFIG_H -c bsd-closefrom.c
during RTL pass: zero_call_used_regs
bsd-closefrom.c: In function ‘closefrom’:
bsd-closefrom.c:151:1: internal compiler error: in change_address_1, at
emit-rtl.cc:2287
  151 | }
      | ^
0x7f5f7d66f189 __libc_start_call_main
        ../sysdeps/nptl/libc_start_call_main.h:58
0x7f5f7d66f244 __libc_start_main_impl
        ../csu/libc-start.c:381
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <http://bugs.buildroot.net/> for instructions.

Using -fzero-call-used-regs=used fixes the build issue.

gcc -v:
/home/browa22-ext/openssh/output/host/bin/m68k-buildroot-linux-uclibc-gcc -v
Using built-in specs.
COLLECT_GCC=/home/browa22-ext/openssh/output/host/bin/m68k-buildroot-linux-uclibc-gcc.br_real
COLLECT_LTO_WRAPPER=/home/browa22-ext/openssh/output/host/libexec/gcc/m68k-buildroot-linux-uclibc/13.2.0/lto-wrapper
Target: m68k-buildroot-linux-uclibc
Configured with: ./configure --prefix=/home/browa22-ext/openssh/output/host
--sysconfdir=/home/browa22-ext/openssh/output/host/etc --enable-static
--target=m68k-buildroot-linux-uclibc
--with-sysroot=/home/browa22-ext/openssh/output/host/m68k-buildroot-linux-uclibc/sysroot
--enable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib
--disable-decimal-float --enable-plugins --enable-lto
--with-gmp=/home/browa22-ext/openssh/output/host
--with-mpc=/home/browa22-ext/openssh/output/host
--with-mpfr=/home/browa22-ext/openssh/output/host --with-pkgversion='Buildroot
2023.08-rc1-23-g3693462a1f' --with-bugurl=http://bugs.buildroot.net/
--without-zstd --disable-libquadmath --disable-libquadmath-support
--disable-libsanitizer --enable-tls --enable-threads --without-isl
--without-cloog --with-cpu=68040 --enable-languages=c
--with-build-time-tools=/home/browa22-ext/openssh/output/host/m68k-buildroot-linux-uclibc/bin
--enable-shared --disable-libgomp
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 13.2.0 (Buildroot 2023.08-rc1-23-g3693462a1f) 
COMPILER_PATH=/home/browa22-ext/openssh/output/host/libexec/gcc/m68k-buildroot-linux-uclibc/13.2.0/:/home/browa22-ext/openssh/output/host/libexec/gcc/m68k-buildroot-linux-uclibc/13.2.0/:/home/browa22-ext/openssh/output/host/libexec/gcc/m68k-buildroot-linux-uclibc/:/home/browa22-ext/openssh/output/host/lib/gcc/m68k-buildroot-linux-uclibc/13.2.0/:/home/browa22-ext/openssh/output/host/lib/gcc/m68k-buildroot-linux-uclibc/:/home/browa22-ext/openssh/output/host/lib/gcc/m68k-buildroot-linux-uclibc/13.2.0/../../../../m68k-buildroot-linux-uclibc/bin/
LIBRARY_PATH=/home/browa22-ext/openssh/output/host/lib/gcc/m68k-buildroot-linux-uclibc/13.2.0/:/home/browa22-ext/openssh/output/host/lib/gcc/m68k-buildroot-linux-uclibc/13.2.0/../../../../m68k-buildroot-linux-uclibc/lib/:/home/browa22-ext/openssh/output/host/m68k-buildroot-linux-uclibc/sysroot/lib/:/home/browa22-ext/openssh/output/host/m68k-buildroot-linux-uclibc/sysroot/usr/lib/
COLLECT_GCC_OPTIONS='--sysroot=/home/browa22-ext/openssh/output/host/m68k-buildroot-linux-uclibc/sysroot'
'-v' '-mcpu=68040' '-dumpdir' 'a.'

/home/browa22-ext/openssh/output/host/libexec/gcc/m68k-buildroot-linux-uclibc/13.2.0/collect2
-plugin
/home/browa22-ext/openssh/output/host/libexec/gcc/m68k-buildroot-linux-uclibc/13.2.0/liblto_plugin.so
-plugin-opt=/home/browa22-ext/openssh/output/host/libexec/gcc/m68k-buildroot-linux-uclibc/13.2.0/lto-wrapper
-plugin-opt=-fresolution=/tmp/cclgUbWV.res -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s
--sysroot=/home/browa22-ext/openssh/output/host/m68k-buildroot-linux-uclibc/sysroot
--eh-frame-hdr -m m68kelf -dynamic-linker /lib/ld-uClibc.so.0
/home/browa22-ext/openssh/output/host/m68k-buildroot-linux-uclibc/sysroot/usr/lib/crt1.o
/home/browa22-ext/openssh/output/host/m68k-buildroot-linux-uclibc/sysroot/usr/lib/crti.o
/home/browa22-ext/openssh/output/host/lib/gcc/m68k-buildroot-linux-uclibc/13.2.0/crtbegin.o
-L/home/browa22-ext/openssh/output/host/lib/gcc/m68k-buildroot-linux-uclibc/13.2.0
-L/home/browa22-ext/openssh/output/host/lib/gcc/m68k-buildroot-linux-uclibc/13.2.0/../../../../m68k-buildroot-linux-uclibc/lib
-L/home/browa22-ext/openssh/output/host/m68k-buildroot-linux-uclibc/sysroot/lib
-L/home/browa22-ext/openssh/output/host/m68k-buildroot-linux-uclibc/sysroot/usr/lib
-z relro -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc
--push-state --as-needed -lgcc_s --pop-state
/home/browa22-ext/openssh/output/host/lib/gcc/m68k-buildroot-linux-uclibc/13.2.0/crtend.o
/home/browa22-ext/openssh/output/host/m68k-buildroot-linux-uclibc/sysroot/usr/lib/crtn.o
/home/browa22-ext/openssh/output/host/lib/gcc/m68k-buildroot-linux-uclibc/13.2.0/../../../../m68k-buildroot-linux-uclibc/bin/ld:
/home/browa22-ext/openssh/output/host/m68k-buildroot-linux-uclibc/sysroot/usr/lib/crt1.o:
in function `_start':
(.text+0x1c): undefined reference to `main'
collect2: error: ld returned 1 exit status

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

* [Bug rtl-optimization/110934] m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2
  2023-08-07 11:33 [Bug c/110934] New: m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2 wbx at openadk dot org
@ 2023-08-07 12:03 ` rguenth at gcc dot gnu.org
  2023-08-07 12:07 ` wbx at openadk dot org
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-08-07 12:03 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |m68k
          Component|c                           |rtl-optimization
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-08-07
           Keywords|                            |ice-on-valid-code
             Status|UNCONFIRMED                 |WAITING

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Can you please provide preprocessed source?

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

* [Bug rtl-optimization/110934] m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2
  2023-08-07 11:33 [Bug c/110934] New: m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2 wbx at openadk dot org
  2023-08-07 12:03 ` [Bug rtl-optimization/110934] " rguenth at gcc dot gnu.org
@ 2023-08-07 12:07 ` wbx at openadk dot org
  2023-08-07 12:07 ` wbx at openadk dot org
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: wbx at openadk dot org @ 2023-08-07 12:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Waldemar Brodkorb <wbx at openadk dot org> ---
Created attachment 55701
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55701&action=edit
bsd-closefrom preprocessed

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

* [Bug rtl-optimization/110934] m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2
  2023-08-07 11:33 [Bug c/110934] New: m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2 wbx at openadk dot org
  2023-08-07 12:03 ` [Bug rtl-optimization/110934] " rguenth at gcc dot gnu.org
  2023-08-07 12:07 ` wbx at openadk dot org
@ 2023-08-07 12:07 ` wbx at openadk dot org
  2023-08-07 14:52 ` [Bug target/110934] " pinskia at gcc dot gnu.org
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: wbx at openadk dot org @ 2023-08-07 12:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Waldemar Brodkorb <wbx at openadk dot org> ---
Is this correct to use -E to generate the file?

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

* [Bug target/110934] m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2
  2023-08-07 11:33 [Bug c/110934] New: m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2 wbx at openadk dot org
                   ` (2 preceding siblings ...)
  2023-08-07 12:07 ` wbx at openadk dot org
@ 2023-08-07 14:52 ` pinskia at gcc dot gnu.org
  2023-08-07 16:41 ` mikpelinux at gmail dot com
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-08-07 14:52 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=108640,
                   |                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=80786
             Status|WAITING                     |UNCONFIRMED
          Component|rtl-optimization            |target
     Ever confirmed|1                           |0

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

* [Bug target/110934] m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2
  2023-08-07 11:33 [Bug c/110934] New: m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2 wbx at openadk dot org
                   ` (3 preceding siblings ...)
  2023-08-07 14:52 ` [Bug target/110934] " pinskia at gcc dot gnu.org
@ 2023-08-07 16:41 ` mikpelinux at gmail dot com
  2023-12-20  3:40 ` sjames at gcc dot gnu.org
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: mikpelinux at gmail dot com @ 2023-08-07 16:41 UTC (permalink / raw)
  To: gcc-bugs

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

Mikael Pettersson <mikpelinux at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikpelinux at gmail dot com

--- Comment #4 from Mikael Pettersson <mikpelinux at gmail dot com> ---
I can reproduce with m68k-unknown-linux-gnu-gcc -Os -fzero-call-used-regs=all
-fPIC.

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

* [Bug target/110934] m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2
  2023-08-07 11:33 [Bug c/110934] New: m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2 wbx at openadk dot org
                   ` (4 preceding siblings ...)
  2023-08-07 16:41 ` mikpelinux at gmail dot com
@ 2023-12-20  3:40 ` sjames at gcc dot gnu.org
  2023-12-27 22:15 ` mikpelinux at gmail dot com
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-12-20  3:40 UTC (permalink / raw)
  To: gcc-bugs

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

Sam James <sjames at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2023-08-07 00:00:00         |2023-12-20
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #5 from Sam James <sjames at gcc dot gnu.org> ---
(In reply to Mikael Pettersson from comment #4)
> I can reproduce with m68k-unknown-linux-gnu-gcc -Os
> -fzero-call-used-regs=all -fPIC.

Hence confirmed.

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

* [Bug target/110934] m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2
  2023-08-07 11:33 [Bug c/110934] New: m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2 wbx at openadk dot org
                   ` (5 preceding siblings ...)
  2023-12-20  3:40 ` sjames at gcc dot gnu.org
@ 2023-12-27 22:15 ` mikpelinux at gmail dot com
  2023-12-28 13:44 ` mikpelinux at gmail dot com
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: mikpelinux at gmail dot com @ 2023-12-27 22:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Mikael Pettersson <mikpelinux at gmail dot com> ---
Affects gcc-11 and newer, gcc-10 and older are ok. Started with:

d10f3e900b0377b4760a090b0f90371bcef01686 is the first new commit
commit d10f3e900b0377b4760a090b0f90371bcef01686
Author: qing zhao <qinzhao@gcc.gnu.org>
Date:   Fri Oct 30 20:41:38 2020 +0100

    Add -fzero-call-used-regs option and zero_call_used_regs function
attributes.

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

* [Bug target/110934] m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2
  2023-08-07 11:33 [Bug c/110934] New: m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2 wbx at openadk dot org
                   ` (6 preceding siblings ...)
  2023-12-27 22:15 ` mikpelinux at gmail dot com
@ 2023-12-28 13:44 ` mikpelinux at gmail dot com
  2023-12-28 17:38 ` mikpelinux at gmail dot com
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: mikpelinux at gmail dot com @ 2023-12-28 13:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Mikael Pettersson <mikpelinux at gmail dot com> ---
The issue appears to be the clearing of FP regs. If I add an m68k-specific
version of TARGET_ZERO_CALL_USED_REGS which handles integer (address and data)
regs but skips FP regs, then the test case compiles fine.

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

* [Bug target/110934] m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2
  2023-08-07 11:33 [Bug c/110934] New: m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2 wbx at openadk dot org
                   ` (7 preceding siblings ...)
  2023-12-28 13:44 ` mikpelinux at gmail dot com
@ 2023-12-28 17:38 ` mikpelinux at gmail dot com
  2023-12-28 18:01 ` mikpelinux at gmail dot com
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: mikpelinux at gmail dot com @ 2023-12-28 17:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Mikael Pettersson <mikpelinux at gmail dot com> ---
The generic code synthesizes a move from CONST0_RTX (XFmode) to an XFmode FP
reg, and that causes the ice. Forcing the mode of both to SFmode or DFmode
avoids the ice and generates sane-looking code. The XFmode comes from the
generic code's use of regno_reg_rtx[regno] (in zcur_select_mode_rtx).

I'm not sure if overriding TARGET_ZERO_CALL_USED_REGS on m68k is the right
thing to do, or if it only masks a deeper problem within the backend.

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

* [Bug target/110934] m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2
  2023-08-07 11:33 [Bug c/110934] New: m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2 wbx at openadk dot org
                   ` (8 preceding siblings ...)
  2023-12-28 17:38 ` mikpelinux at gmail dot com
@ 2023-12-28 18:01 ` mikpelinux at gmail dot com
  2023-12-28 20:39 ` pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: mikpelinux at gmail dot com @ 2023-12-28 18:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Mikael Pettersson <mikpelinux at gmail dot com> ---
Created attachment 56961
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56961&action=edit
proposed fix, only tested on the given test case so far

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

* [Bug target/110934] m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2
  2023-08-07 11:33 [Bug c/110934] New: m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2 wbx at openadk dot org
                   ` (9 preceding siblings ...)
  2023-12-28 18:01 ` mikpelinux at gmail dot com
@ 2023-12-28 20:39 ` pinskia at gcc dot gnu.org
  2024-01-04 16:13 ` mikpelinux at gmail dot com
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-12-28 20:39 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ats-gccbugs at offog dot org

--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 113086 has been marked as a duplicate of this bug. ***

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

* [Bug target/110934] m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2
  2023-08-07 11:33 [Bug c/110934] New: m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2 wbx at openadk dot org
                   ` (10 preceding siblings ...)
  2023-12-28 20:39 ` pinskia at gcc dot gnu.org
@ 2024-01-04 16:13 ` mikpelinux at gmail dot com
  2024-01-18 16:43 ` mikpelinux at gmail dot com
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: mikpelinux at gmail dot com @ 2024-01-04 16:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Mikael Pettersson <mikpelinux at gmail dot com> ---
Reduced test case:

> cat ../pr110934.c 
extern double clobber_fp0(void);
void f(void) { clobber_fp0(); }
> gcc/xgcc -Bgcc -fzero-call-used-regs=used -fPIC -O -S ../pr110934.c
during RTL pass: zero_call_used_regs
../pr110934.c: In function 'f':
../pr110934.c:2:31: internal compiler error: in change_address_1, at
emit-rtl.cc:2299
    2 | void f(void) { clobber_fp0(); }
      |                              ^
0x40dc15 change_address_1
        /mnt/scratch/other/mikpe-gcc.git/gcc/emit-rtl.cc:2299
0x69dc1e emit_move_insn(rtx_def*, rtx_def*)
        /mnt/scratch/other/mikpe-gcc.git/gcc/expr.cc:4717
0xa0cf63 default_zero_call_used_regs(unsigned long)
        /mnt/scratch/other/mikpe-gcc.git/gcc/targhooks.cc:1112
0x6ed8fa gen_call_used_regs_seq
        /mnt/scratch/other/mikpe-gcc.git/gcc/function.cc:5928
0x6ed8fa execute
        /mnt/scratch/other/mikpe-gcc.git/gcc/function.cc:6785
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.

The issue is that to zero %fp0 the generic code synthesizes a move from
(const_double:XF 0.0 [0x0.0p+0]) which is replaced by a label referencing a
literal in .rodata, but that label is rejected by
m68k_legitimate_constant_address_p due to -fPIC, which triggers the assertion
failure in change_address_1.

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

* [Bug target/110934] m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2
  2023-08-07 11:33 [Bug c/110934] New: m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2 wbx at openadk dot org
                   ` (11 preceding siblings ...)
  2024-01-04 16:13 ` mikpelinux at gmail dot com
@ 2024-01-18 16:43 ` mikpelinux at gmail dot com
  2024-01-19 23:24 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: mikpelinux at gmail dot com @ 2024-01-18 16:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Mikael Pettersson <mikpelinux at gmail dot com> ---
Patch posted:
https://gcc.gnu.org/pipermail/gcc-patches/2024-January/643276.html

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

* [Bug target/110934] m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2
  2023-08-07 11:33 [Bug c/110934] New: m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2 wbx at openadk dot org
                   ` (12 preceding siblings ...)
  2024-01-18 16:43 ` mikpelinux at gmail dot com
@ 2024-01-19 23:24 ` cvs-commit at gcc dot gnu.org
  2024-01-19 23:25 ` law at gcc dot gnu.org
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-19 23:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jeff Law <law@gcc.gnu.org>:

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

commit r14-8299-gf1dea0fed946ba40bd6bbe40ad1386aa9303418c
Author: Mikael Pettersson <mikpelinux@gmail.com>
Date:   Fri Jan 19 16:23:34 2024 -0700

    [PATCH] Avoid ICE on m68k -fzero-call-used-regs -fpic [PR110934]

    PR110934 is a problem on m68k where -fzero-call-used-regs -fpic ICEs
    when clearing an FP register.

    The generic code generates an XFmode move of zero to that register,
    which becomes an XFmode load from initialized data, which due to -fpic
    uses a non-constant address, which the backend rejects.  The
    zero-call-used-regs pass runs very late, after register allocation and
    frame layout, and at that point we can't allow new uses of the PIC
    register or new pseudos.

    To clear an FP register on m68k it's enough to do the move in SFmode,
    but the generic code can't be told to do that, so this patch updates
    m68k to use its own TARGET_ZERO_CALL_USED_REGS.

    Bootstrapped and regression tested on m68k-linux-gnu.

    Ok for master? (I don't have commit rights.)

    gcc/

            PR target/110934
            * config/m68k/m68k.cc (m68k_zero_call_used_regs): New function.
            (TARGET_ZERO_CALL_USED_REGS): Define.

    gcc/testsuite/

            PR target/110934
            * gcc.target/m68k/pr110934.c: New test.

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

* [Bug target/110934] m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2
  2023-08-07 11:33 [Bug c/110934] New: m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2 wbx at openadk dot org
                   ` (13 preceding siblings ...)
  2024-01-19 23:24 ` cvs-commit at gcc dot gnu.org
@ 2024-01-19 23:25 ` law at gcc dot gnu.org
  2024-01-25  6:24 ` sjames at gcc dot gnu.org
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: law at gcc dot gnu.org @ 2024-01-19 23:25 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
                 CC|                            |law at gcc dot gnu.org
             Status|NEW                         |RESOLVED

--- Comment #14 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Fixed on the trunk.  No plans to backport.

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

* [Bug target/110934] m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2
  2023-08-07 11:33 [Bug c/110934] New: m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2 wbx at openadk dot org
                   ` (14 preceding siblings ...)
  2024-01-19 23:25 ` law at gcc dot gnu.org
@ 2024-01-25  6:24 ` sjames at gcc dot gnu.org
  2024-03-16  0:09 ` pinskia at gcc dot gnu.org
  2024-03-25 13:26 ` sjames at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-01-25  6:24 UTC (permalink / raw)
  To: gcc-bugs

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

Sam James <sjames at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0

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

* [Bug target/110934] m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2
  2023-08-07 11:33 [Bug c/110934] New: m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2 wbx at openadk dot org
                   ` (15 preceding siblings ...)
  2024-01-25  6:24 ` sjames at gcc dot gnu.org
@ 2024-03-16  0:09 ` pinskia at gcc dot gnu.org
  2024-03-25 13:26 ` sjames at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-16  0:09 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |doko at gcc dot gnu.org

--- Comment #15 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 114358 has been marked as a duplicate of this bug. ***

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

* [Bug target/110934] m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2
  2023-08-07 11:33 [Bug c/110934] New: m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2 wbx at openadk dot org
                   ` (16 preceding siblings ...)
  2024-03-16  0:09 ` pinskia at gcc dot gnu.org
@ 2024-03-25 13:26 ` sjames at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-03-25 13:26 UTC (permalink / raw)
  To: gcc-bugs

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

Sam James <sjames at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rene at exactcode dot de

--- Comment #16 from Sam James <sjames at gcc dot gnu.org> ---
*** Bug 114466 has been marked as a duplicate of this bug. ***

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

end of thread, other threads:[~2024-03-25 13:26 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-07 11:33 [Bug c/110934] New: m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2 wbx at openadk dot org
2023-08-07 12:03 ` [Bug rtl-optimization/110934] " rguenth at gcc dot gnu.org
2023-08-07 12:07 ` wbx at openadk dot org
2023-08-07 12:07 ` wbx at openadk dot org
2023-08-07 14:52 ` [Bug target/110934] " pinskia at gcc dot gnu.org
2023-08-07 16:41 ` mikpelinux at gmail dot com
2023-12-20  3:40 ` sjames at gcc dot gnu.org
2023-12-27 22:15 ` mikpelinux at gmail dot com
2023-12-28 13:44 ` mikpelinux at gmail dot com
2023-12-28 17:38 ` mikpelinux at gmail dot com
2023-12-28 18:01 ` mikpelinux at gmail dot com
2023-12-28 20:39 ` pinskia at gcc dot gnu.org
2024-01-04 16:13 ` mikpelinux at gmail dot com
2024-01-18 16:43 ` mikpelinux at gmail dot com
2024-01-19 23:24 ` cvs-commit at gcc dot gnu.org
2024-01-19 23:25 ` law at gcc dot gnu.org
2024-01-25  6:24 ` sjames at gcc dot gnu.org
2024-03-16  0:09 ` pinskia at gcc dot gnu.org
2024-03-25 13:26 ` sjames 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).