public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/113637] New: ICE: in as_a, at machmode.h:381 with extern function declaration and _BitInt() used as VLA size
@ 2024-01-28 14:11 zsojka at seznam dot cz
  2024-01-30  7:16 ` [Bug debug/113637] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: zsojka at seznam dot cz @ 2024-01-28 14:11 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113637
           Summary: ICE: in as_a, at machmode.h:381 with extern function
                    declaration and _BitInt() used as VLA size
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: debug
          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 57244
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57244&action=edit
reduced testcase (from gcc.dg/Wvla-parameter-4.c)

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c -g
testcase.c: In function 'foo':
testcase.c:5:1: internal compiler error: in as_a, at machmode.h:381
    5 | }
      | ^
0x7418a8 scalar_int_mode as_a<scalar_int_mode>(machine_mode)
        /repo/gcc-trunk/gcc/machmode.h:381
0x748787 scalar_int_mode as_a<scalar_int_mode>(machine_mode)
        /repo/gcc-trunk/gcc/tree.h:3813
0x748787 loc_list_from_tree_1
        /repo/gcc-trunk/gcc/dwarf2out.cc:19030
0x1058d7b loc_list_from_tree_1
        /repo/gcc-trunk/gcc/dwarf2out.cc:19443
0x1066138 loc_list_from_tree
        /repo/gcc-trunk/gcc/dwarf2out.cc:19737
0x1066138 add_scalar_info
        /repo/gcc-trunk/gcc/dwarf2out.cc:21528
0x10671e1 add_subscript_info
        /repo/gcc-trunk/gcc/dwarf2out.cc:21767
0x1053f12 gen_array_type_die
        /repo/gcc-trunk/gcc/dwarf2out.cc:22641
0x1053f12 gen_type_die_with_usage
        /repo/gcc-trunk/gcc/dwarf2out.cc:26433
0x10557fd gen_type_die
        /repo/gcc-trunk/gcc/dwarf2out.cc:26496
0x10557fd modified_type_die
        /repo/gcc-trunk/gcc/dwarf2out.cc:13924
0x1055dc5 modified_type_die
        /repo/gcc-trunk/gcc/dwarf2out.cc:14068
0x10577a6 add_type_attribute
        /repo/gcc-trunk/gcc/dwarf2out.cc:22387
0x1068fc1 gen_formal_parameter_die
        /repo/gcc-trunk/gcc/dwarf2out.cc:23096
0x10693ce gen_formal_types_die
        /repo/gcc-trunk/gcc/dwarf2out.cc:23191
0x104ce8b gen_subprogram_die
        /repo/gcc-trunk/gcc/dwarf2out.cc:24063
0x10508ca gen_decl_die
        /repo/gcc-trunk/gcc/dwarf2out.cc:27113
0x106e6cf decls_for_scope
        /repo/gcc-trunk/gcc/dwarf2out.cc:26676
0x104beee gen_subprogram_die
        /repo/gcc-trunk/gcc/dwarf2out.cc:24174
0x10508ca gen_decl_die
        /repo/gcc-trunk/gcc/dwarf2out.cc:27113
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-8474-20240128132141-g46df13697a4-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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
--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-8474-20240128132141-g46df13697a4-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240128 (experimental) (GCC)

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

* [Bug debug/113637] ICE: in as_a, at machmode.h:381 with extern function declaration and _BitInt() used as VLA size
  2024-01-28 14:11 [Bug debug/113637] New: ICE: in as_a, at machmode.h:381 with extern function declaration and _BitInt() used as VLA size zsojka at seznam dot cz
@ 2024-01-30  7:16 ` pinskia at gcc dot gnu.org
  2024-01-30  7:19 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-30  7:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-01-30
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

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

* [Bug debug/113637] ICE: in as_a, at machmode.h:381 with extern function declaration and _BitInt() used as VLA size
  2024-01-28 14:11 [Bug debug/113637] New: ICE: in as_a, at machmode.h:381 with extern function declaration and _BitInt() used as VLA size zsojka at seznam dot cz
  2024-01-30  7:16 ` [Bug debug/113637] " pinskia at gcc dot gnu.org
@ 2024-01-30  7:19 ` pinskia at gcc dot gnu.org
  2024-01-30 16:53 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-30  7:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
                && (INTEGRAL_TYPE_P (TREE_TYPE (loc))
                    || POINTER_TYPE_P (TREE_TYPE (loc)))
                && (GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (TREE_TYPE (loc)))
                    <= DWARF2_ADDR_SIZE))

Maybe TYPE_PRECISION instead of `GET_MODE_SIZE (SCALAR_INT_TYPE_MODE`?

Note this code was added by r7-6893-g680c60feb43035.

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

* [Bug debug/113637] ICE: in as_a, at machmode.h:381 with extern function declaration and _BitInt() used as VLA size
  2024-01-28 14:11 [Bug debug/113637] New: ICE: in as_a, at machmode.h:381 with extern function declaration and _BitInt() used as VLA size zsojka at seznam dot cz
  2024-01-30  7:16 ` [Bug debug/113637] " pinskia at gcc dot gnu.org
  2024-01-30  7:19 ` pinskia at gcc dot gnu.org
@ 2024-01-30 16:53 ` jakub at gcc dot gnu.org
  2024-01-31  9:56 ` cvs-commit at gcc dot gnu.org
  2024-01-31 10:30 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-30 16:53 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

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

Types with BLKmode TYPE_MODE will be certainly larger than DWARF2_ADDR_SIZE...

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

* [Bug debug/113637] ICE: in as_a, at machmode.h:381 with extern function declaration and _BitInt() used as VLA size
  2024-01-28 14:11 [Bug debug/113637] New: ICE: in as_a, at machmode.h:381 with extern function declaration and _BitInt() used as VLA size zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2024-01-30 16:53 ` jakub at gcc dot gnu.org
@ 2024-01-31  9:56 ` cvs-commit at gcc dot gnu.org
  2024-01-31 10:30 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-31  9:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 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:457d2b59b58e5998e1e6967316d4e3e8f24edeed

commit r14-8651-g457d2b59b58e5998e1e6967316d4e3e8f24edeed
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Jan 31 10:56:15 2024 +0100

    dwarf2out: Fix ICE on large _BitInt in loc_list_from_tree_1 [PR113637]

    This spot uses SCALAR_INT_TYPE_MODE which obviously ICEs for large/huge
    BITINT_TYPE types which have BLKmode.  But such large BITINT_TYPEs
certainly
    don't fit into DWARF2_ADDR_SIZE either, so we can just assume it would be
    false if type has BLKmode.

    2024-01-31  Jakub Jelinek  <jakub@redhat.com>

            PR debug/113637
            * dwarf2out.cc (loc_list_from_tree_1): Assume integral types
            with BLKmode are larger than DWARF2_ADDR_SIZE.

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

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

* [Bug debug/113637] ICE: in as_a, at machmode.h:381 with extern function declaration and _BitInt() used as VLA size
  2024-01-28 14:11 [Bug debug/113637] New: ICE: in as_a, at machmode.h:381 with extern function declaration and _BitInt() used as VLA size zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2024-01-31  9:56 ` cvs-commit at gcc dot gnu.org
@ 2024-01-31 10:30 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-31 10:30 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

end of thread, other threads:[~2024-01-31 10:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-28 14:11 [Bug debug/113637] New: ICE: in as_a, at machmode.h:381 with extern function declaration and _BitInt() used as VLA size zsojka at seznam dot cz
2024-01-30  7:16 ` [Bug debug/113637] " pinskia at gcc dot gnu.org
2024-01-30  7:19 ` pinskia at gcc dot gnu.org
2024-01-30 16:53 ` jakub at gcc dot gnu.org
2024-01-31  9:56 ` cvs-commit at gcc dot gnu.org
2024-01-31 10:30 ` 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).