public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/95142] New: ICE when compiling certain logic with -Ofast and -mpretend-cmove when dealing with floats
@ 2020-05-14 20:09 hayden at hkowsoftware dot com
  2020-05-14 20:32 ` [Bug c/95142] " gabravier at gmail dot com
  2020-05-14 20:42 ` hayden at hkowsoftware dot com
  0 siblings, 2 replies; 3+ messages in thread
From: hayden at hkowsoftware dot com @ 2020-05-14 20:09 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95142
           Summary: ICE when compiling certain logic with -Ofast and
                    -mpretend-cmove when dealing with floats
           Product: gcc
           Version: 9.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hayden at hkowsoftware dot com
  Target Milestone: ---

Created attachment 48537
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48537&action=edit
small self contained example showing the crash

this issue is exhibited by the included source in versions gcc 9.3 and 10.0.1
for the sh4 target.

It seems to be related to using cmove when dealing with access to a float using
an index from a pointer, included is a small ~60 line example demonstrating
this.

sh4-linux-gnu-gcc-9-Ofast -mpretend-cmove -c ice_sh4.c

ice_sh4.c: In function ‘call_create’:
ice_sh4.c:48:1: error: unrecognizable insn:
   48 | }
      | ^
(insn 26 25 27 2 (parallel [
            (set (reg:SI 147 t)
                (ge:SI (reg/v:SF 170 [ size_1 ])
                    (reg/v:SF 167 [ size_0 ])))
            (clobber (reg:SI 155 fpscr1))
            (use (reg:SI 154 fpscr0))
        ]) "ice_sh4.c":41:29 -1
     (nil))
during RTL pass: vregs
ice_sh4.c:48:1: internal compiler error: in extract_insn, at recog.c:2310



version info for gcc 9.3:
Using built-in specs.
COLLECT_GCC=sh4-linux-gnu-gcc-9
COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/sh4-linux-gnu/9/lto-wrapper
Target: sh4-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 9.3.0-8'
--with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs
--enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr
--with-gcc-major-version-only --program-suffix=-9 --enable-shared
--enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/
--enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-libsanitizer --disable-libquadmath --disable-libquadmath-support
--enable-plugin --with-system-zlib --disable-libphobos --enable-multiarch
--disable-werror --with-cpu=sh4 --with-multilib-list=m4,m4-nofpu
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=sh4-linux-gnu --program-prefix=sh4-linux-gnu-
--includedir=/usr/sh4-linux-gnu/include --with-build-config=bootstrap-lto-lean
--enable-link-mutex
Thread model: posix
gcc version 9.3.0 (Debian 9.3.0-8)


version info for gcc 10.0.1:
Using built-in specs.
COLLECT_GCC=sh4-linux-gnu-gcc-10
COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/sh4-linux-gnu/10/lto-wrapper
Target: sh4-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 10-20200418-1'
--with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs
--enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr
--with-gcc-major-version-only --program-suffix=-10 --enable-shared
--enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/
--enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-libsanitizer --disable-libquadmath --disable-libquadmath-support
--enable-plugin --with-system-zlib --disable-libphobos --enable-multiarch
--disable-werror --with-cpu=sh4 --with-multilib-list=m4,m4-nofpu
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=sh4-linux-gnu --program-prefix=sh4-linux-gnu-
--includedir=/usr/sh4-linux-gnu/include
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.0.1 20200418 (experimental) [master revision
27c171775ab:4c277008be0:c5bac7d127f288fd2f8a1f15c3f30da5903141c6] (Debian
10-20200418-1)

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

* [Bug c/95142] ICE when compiling certain logic with -Ofast and -mpretend-cmove when dealing with floats
  2020-05-14 20:09 [Bug c/95142] New: ICE when compiling certain logic with -Ofast and -mpretend-cmove when dealing with floats hayden at hkowsoftware dot com
@ 2020-05-14 20:32 ` gabravier at gmail dot com
  2020-05-14 20:42 ` hayden at hkowsoftware dot com
  1 sibling, 0 replies; 3+ messages in thread
From: gabravier at gmail dot com @ 2020-05-14 20:32 UTC (permalink / raw)
  To: gcc-bugs

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

Gabriel Ravier <gabravier at gmail dot com> changed:

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

--- Comment #1 from Gabriel Ravier <gabravier at gmail dot com> ---
I can reproduce this on Fedora 32 with `sh-linux-gnu-gcc` (which uses GCC 9.2)
: 

$ sh-linux-gnu-gcc -Ofast -m4 -mpretend-cmove -c ice_sh4.c 
ice_sh4.c: In function ‘call_create’:
ice_sh4.c:48:1: error: unrecognizable insn:
   48 | }
      | ^
(insn 26 25 27 2 (parallel [
            (set (reg:SI 147 t)
                (ge:SI (reg/v:SF 170 [ size_1 ])
                    (reg/v:SF 167 [ size_0 ])))
            (clobber (reg:SI 155 fpscr1))
            (use (reg:SI 154 fpscr0))
        ]) "ice_sh4.c":41:29 -1
     (nil))
during RTL pass: vregs
ice_sh4.c:48:1: internal compiler error: in extract_insn, at recog.c:2310
0x7f37befd0041 __libc_start_main
        ../csu/libc-start.c:308
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://bugzilla.redhat.com/bugzilla/> for instructions.
The bug is not reproducible, so it is likely a hardware or OS problem.
$ sh-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/sh-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/sh-linux-gnu/9/lto-wrapper
Target: sh-linux-gnu
Configured with: ../gcc-9.2.1-20190827/configure --bindir=/usr/bin
--build=x86_64-redhat-linux-gnu --datadir=/usr/share --disable-decimal-float
--disable-dependency-tracking --disable-gold --disable-libgcj --disable-libgomp
--disable-libmpx --disable-libquadmath --disable-libssp
--disable-libunwind-exceptions --disable-shared --disable-silent-rules
--disable-sjlj-exceptions --disable-threads --with-ld=/usr/bin/sh-linux-gnu-ld
--enable-__cxa_atexit --enable-checking=release --enable-gnu-unique-object
--enable-initfini-array --enable-languages=c,c++ --enable-linker-build-id
--enable-lto --enable-nls --enable-obsolete --enable-plugin
--enable-targets=all --exec-prefix=/usr --host=x86_64-redhat-linux-gnu
--includedir=/usr/include --infodir=/usr/share/info --libexecdir=/usr/libexec
--localstatedir=/var --mandir=/usr/share/man --prefix=/usr
--program-prefix=sh-linux-gnu- --sbindir=/usr/sbin --sharedstatedir=/var/lib
--sysconfdir=/etc --target=sh-linux-gnu
--with-bugurl=http://bugzilla.redhat.com/bugzilla/
--with-gcc-major-version-only --with-isl --with-newlib
--with-plugin-ld=/usr/bin/sh-linux-gnu-ld
--with-sysroot=/usr/sh-linux-gnu/sys-root --with-system-libunwind
--with-system-zlib --without-headers
--with-multilib-list=m1,m2,m2e,m2a,m2a-single,m4,m4-single,m4-single-only,m4-nofpu
--with-linker-hash-style=gnu
Thread model: single
gcc version 9.2.1 20190827 (Red Hat Cross 9.2.1-3) (GCC) 


Reproducing it requires `-m4` here (doesn't work with nothing or another
architecture like `-m3`), so it is most likely a bug specific to SH4-specific
code.

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

* [Bug c/95142] ICE when compiling certain logic with -Ofast and -mpretend-cmove when dealing with floats
  2020-05-14 20:09 [Bug c/95142] New: ICE when compiling certain logic with -Ofast and -mpretend-cmove when dealing with floats hayden at hkowsoftware dot com
  2020-05-14 20:32 ` [Bug c/95142] " gabravier at gmail dot com
@ 2020-05-14 20:42 ` hayden at hkowsoftware dot com
  1 sibling, 0 replies; 3+ messages in thread
From: hayden at hkowsoftware dot com @ 2020-05-14 20:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Hayden Kowalchuk <hayden at hkowsoftware dot com> ---
slightly further testing shows all affected versions only need these flags to
trigger

sh4-linux-gnu-gcc-* -O1 -ffast-math -mpretend-cmove -c ice_sh4.c

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

end of thread, other threads:[~2020-05-14 20:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-14 20:09 [Bug c/95142] New: ICE when compiling certain logic with -Ofast and -mpretend-cmove when dealing with floats hayden at hkowsoftware dot com
2020-05-14 20:32 ` [Bug c/95142] " gabravier at gmail dot com
2020-05-14 20:42 ` hayden at hkowsoftware dot com

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).