public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/112901] New: during GIMPLE pass: evrp ICE: in as_a, at machmode.h:381 with _BitInt() at -O2
@ 2023-12-07 11:06 zsojka at seznam dot cz
  2023-12-07 14:50 ` [Bug tree-optimization/112901] " jakub at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: zsojka at seznam dot cz @ 2023-12-07 11:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112901
           Summary: during GIMPLE pass: evrp ICE: in as_a, at
                    machmode.h:381 with _BitInt() at -O2
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

Created attachment 56824
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56824&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 testcase.c 
during GIMPLE pass: evrp
testcase.c: In function 'foo':
testcase.c:8:1: internal compiler error: in as_a, at machmode.h:381
    8 | }
      | ^
0x8abe74 scalar_int_mode as_a<scalar_int_mode>(machine_mode)
        /repo/gcc-trunk/gcc/machmode.h:381
0x8abe74 scalar_float_mode as_a<scalar_float_mode>(machine_mode)
        /repo/gcc-trunk/gcc/machmode.h:379
0x8abe74
simplify_using_ranges::simplify_float_conversion_using_ranges(gimple_stmt_iterator*,
gimple*)
        /repo/gcc-trunk/gcc/vr-values.cc:1648
0x1893d26 simplify_using_ranges::simplify(gimple_stmt_iterator*)
        /repo/gcc-trunk/gcc/vr-values.cc:1970
0x17f4d92 rvrp_folder::fold_stmt(gimple_stmt_iterator*)
        /repo/gcc-trunk/gcc/tree-vrp.cc:1032
0x16db73a substitute_and_fold_dom_walker::before_dom_children(basic_block_def*)
        /repo/gcc-trunk/gcc/tree-ssa-propagate.cc:876
0x258fade dom_walker::walk(basic_block_def*)
        /repo/gcc-trunk/gcc/domwalk.cc:311
0x16daa45 substitute_and_fold_engine::substitute_and_fold(basic_block_def*)
        /repo/gcc-trunk/gcc/tree-ssa-propagate.cc:999
0x17f227a execute_ranger_vrp(function*, bool, bool)
        /repo/gcc-trunk/gcc/tree-vrp.cc:1064
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.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-6267-20231207094857-gbf38c6374b5-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-6267-20231207094857-gbf38c6374b5-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20231207 (experimental) (GCC)

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

* [Bug tree-optimization/112901] during GIMPLE pass: evrp ICE: in as_a, at machmode.h:381 with _BitInt() at -O2
  2023-12-07 11:06 [Bug tree-optimization/112901] New: during GIMPLE pass: evrp ICE: in as_a, at machmode.h:381 with _BitInt() at -O2 zsojka at seznam dot cz
@ 2023-12-07 14:50 ` jakub at gcc dot gnu.org
  2023-12-08  8:02 ` cvs-commit at gcc dot gnu.org
  2023-12-08  8:04 ` jakub at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-12-07 14:50 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-12-07
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 56827
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56827&action=edit
gcc14-pr112901.patch

Untested fix.

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

* [Bug tree-optimization/112901] during GIMPLE pass: evrp ICE: in as_a, at machmode.h:381 with _BitInt() at -O2
  2023-12-07 11:06 [Bug tree-optimization/112901] New: during GIMPLE pass: evrp ICE: in as_a, at machmode.h:381 with _BitInt() at -O2 zsojka at seznam dot cz
  2023-12-07 14:50 ` [Bug tree-optimization/112901] " jakub at gcc dot gnu.org
@ 2023-12-08  8:02 ` cvs-commit at gcc dot gnu.org
  2023-12-08  8:04 ` jakub at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-08  8:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

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

commit r14-6306-gb5cfbb8f4cceb621d6812eec3e0fb876b648241c
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Dec 8 09:02:15 2023 +0100

    vr-values: Avoid ICEs on large _BitInt cast to floating point [PR112901]

    For casts from integers to floating point,
    simplify_float_conversion_using_ranges uses SCALAR_INT_TYPE_MODE
    and queries optabs on the optimization it wants to make.

    That doesn't really work for large/huge BITINT_TYPE, those have BLKmode
    which is not scalar int mode.  Querying an optab is not useful for that
    either.

    I think it is best to just skip this optimization for those bitints,
    after all, bitint lowering uses ranges already to determine minimum
    precision for bitint operands of the integer to float casts.

    2023-12-08  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/112901
            * vr-values.cc
            (simplify_using_ranges::simplify_float_conversion_using_ranges):
            Return false if rhs1 has BITINT_TYPE type with BLKmode TYPE_MODE.

            * gcc.dg/bitint-51.c: New test.

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

* [Bug tree-optimization/112901] during GIMPLE pass: evrp ICE: in as_a, at machmode.h:381 with _BitInt() at -O2
  2023-12-07 11:06 [Bug tree-optimization/112901] New: during GIMPLE pass: evrp ICE: in as_a, at machmode.h:381 with _BitInt() at -O2 zsojka at seznam dot cz
  2023-12-07 14:50 ` [Bug tree-optimization/112901] " jakub at gcc dot gnu.org
  2023-12-08  8:02 ` cvs-commit at gcc dot gnu.org
@ 2023-12-08  8:04 ` jakub at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-12-08  8:04 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2023-12-08  8:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-07 11:06 [Bug tree-optimization/112901] New: during GIMPLE pass: evrp ICE: in as_a, at machmode.h:381 with _BitInt() at -O2 zsojka at seznam dot cz
2023-12-07 14:50 ` [Bug tree-optimization/112901] " jakub at gcc dot gnu.org
2023-12-08  8:02 ` cvs-commit at gcc dot gnu.org
2023-12-08  8:04 ` jakub 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).