public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/112880] New: ICE: in smallest_mode_for_size, at stor-layout.cc:356 with __builtin_mul_overflow() of _BitInt(1024)
@ 2023-12-06 11:32 zsojka at seznam dot cz
  2023-12-06 16:25 ` [Bug tree-optimization/112880] " jakub at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: zsojka at seznam dot cz @ 2023-12-06 11:32 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112880
           Summary: ICE: in smallest_mode_for_size, at stor-layout.cc:356
                    with __builtin_mul_overflow() of _BitInt(1024)
           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 56812
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56812&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c
during GIMPLE pass: cddce
testcase.c: In function 'foo':
testcase.c:7:1: internal compiler error: in smallest_mode_for_size, at
stor-layout.cc:356
    7 | }
      | ^
0x14dedcf smallest_mode_for_size(poly_int<1u, unsigned long>, mode_class)
        /repo/gcc-trunk/gcc/stor-layout.cc:356
0x14e3715 smallest_int_mode_for_size(poly_int<1u, unsigned long>)
        /repo/gcc-trunk/gcc/machmode.h:916
0x14e3715 layout_type(tree_node*)
        /repo/gcc-trunk/gcc/stor-layout.cc:2405
0x1809acc build_nonstandard_integer_type(unsigned long, int)
        /repo/gcc-trunk/gcc/tree.cc:7129
0x16251ec maybe_optimize_arith_overflow
        /repo/gcc-trunk/gcc/tree-ssa-dce.cc:1246
0x16271b1 eliminate_unnecessary_stmts
        /repo/gcc-trunk/gcc/tree-ssa-dce.cc:1491
0x16271b1 perform_tree_ssa_dce
        /repo/gcc-trunk/gcc/tree-ssa-dce.cc:1973
0x1627785 tree_ssa_cd_dce
        /repo/gcc-trunk/gcc/tree-ssa-dce.cc:2014
0x1627785 execute
        /repo/gcc-trunk/gcc/tree-ssa-dce.cc:2097
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-6210-20231206095912-ge44ed92dbbe-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-6210-20231206095912-ge44ed92dbbe-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20231206 (experimental) (GCC)

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

* [Bug tree-optimization/112880] ICE: in smallest_mode_for_size, at stor-layout.cc:356 with __builtin_mul_overflow() of _BitInt(1024)
  2023-12-06 11:32 [Bug tree-optimization/112880] New: ICE: in smallest_mode_for_size, at stor-layout.cc:356 with __builtin_mul_overflow() of _BitInt(1024) zsojka at seznam dot cz
@ 2023-12-06 16:25 ` jakub at gcc dot gnu.org
  2023-12-07  8:48 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-12-06 16:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

Untested fix.

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

* [Bug tree-optimization/112880] ICE: in smallest_mode_for_size, at stor-layout.cc:356 with __builtin_mul_overflow() of _BitInt(1024)
  2023-12-06 11:32 [Bug tree-optimization/112880] New: ICE: in smallest_mode_for_size, at stor-layout.cc:356 with __builtin_mul_overflow() of _BitInt(1024) zsojka at seznam dot cz
  2023-12-06 16:25 ` [Bug tree-optimization/112880] " jakub at gcc dot gnu.org
@ 2023-12-07  8:48 ` cvs-commit at gcc dot gnu.org
  2023-12-07  9:36 ` jakub at gcc dot gnu.org
  2023-12-10 20:32 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-07  8:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:f74939bd539c87f669e35042f7bc7aa47f0c29eb

commit r14-6264-gf74939bd539c87f669e35042f7bc7aa47f0c29eb
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Dec 7 09:46:38 2023 +0100

    tree-ssa-dce: Fix up maybe_optimize_arith_overflow for BITINT_TYPE
[PR112880]

    The following testcase ICEs because maybe_optimize_arith_overflow
    uses build_nonstandard_integer_type, which is inappropriate if
    type is large BITINT_TYPE.

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

            PR tree-optimization/112880
            * tree-ssa-dce.cc (maybe_optimize_arith_overflow): Use
            unsigned_type_for instead of conditionally calling
            build_nonstandard_integer_type.

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

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

* [Bug tree-optimization/112880] ICE: in smallest_mode_for_size, at stor-layout.cc:356 with __builtin_mul_overflow() of _BitInt(1024)
  2023-12-06 11:32 [Bug tree-optimization/112880] New: ICE: in smallest_mode_for_size, at stor-layout.cc:356 with __builtin_mul_overflow() of _BitInt(1024) zsojka at seznam dot cz
  2023-12-06 16:25 ` [Bug tree-optimization/112880] " jakub at gcc dot gnu.org
  2023-12-07  8:48 ` cvs-commit at gcc dot gnu.org
@ 2023-12-07  9:36 ` jakub at gcc dot gnu.org
  2023-12-10 20:32 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-12-07  9:36 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

* [Bug tree-optimization/112880] ICE: in smallest_mode_for_size, at stor-layout.cc:356 with __builtin_mul_overflow() of _BitInt(1024)
  2023-12-06 11:32 [Bug tree-optimization/112880] New: ICE: in smallest_mode_for_size, at stor-layout.cc:356 with __builtin_mul_overflow() of _BitInt(1024) zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2023-12-07  9:36 ` jakub at gcc dot gnu.org
@ 2023-12-10 20:32 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-12-10 20:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

end of thread, other threads:[~2023-12-10 20:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-06 11:32 [Bug tree-optimization/112880] New: ICE: in smallest_mode_for_size, at stor-layout.cc:356 with __builtin_mul_overflow() of _BitInt(1024) zsojka at seznam dot cz
2023-12-06 16:25 ` [Bug tree-optimization/112880] " jakub at gcc dot gnu.org
2023-12-07  8:48 ` cvs-commit at gcc dot gnu.org
2023-12-07  9:36 ` jakub at gcc dot gnu.org
2023-12-10 20:32 ` pinskia 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).