public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/114015] New: ICE: in build_abbrev_table, at dwarf2out.cc:9266 with -g -fvar-tracking-assignments -fdebug-types-section
@ 2024-02-20 18:50 zsojka at seznam dot cz
  2024-02-28 16:24 ` [Bug debug/114015] " jakub at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: zsojka at seznam dot cz @ 2024-02-20 18:50 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114015
           Summary: ICE: in build_abbrev_table, at dwarf2out.cc:9266 with
                    -g -fvar-tracking-assignments -fdebug-types-section
           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
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

Created attachment 57472
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57472&action=edit
reduced testcase (from gcc.dg/pr99122-3.c)

Compiler output:
$ x86_64-pc-linux-gnu-gcc -g -fvar-tracking-assignments -fdebug-types-section
testcase.c -w
testcase.c:1:35: internal compiler error: in build_abbrev_table, at
dwarf2out.cc:9266
    1 | int barfoo(_BitInt(236) n, struct {char a[n];}) {}
      |                                   ^
0x7463b2 build_abbrev_table
        /repo/gcc-trunk/gcc/dwarf2out.cc:9266
0x1046418 build_abbrev_table
        /repo/gcc-trunk/gcc/dwarf2out.cc:9323
0x1046418 build_abbrev_table
        /repo/gcc-trunk/gcc/dwarf2out.cc:9323
0x1046871 output_comdat_type_unit
        /repo/gcc-trunk/gcc/dwarf2out.cc:11473
0x1070e1a dwarf2out_finish
        /repo/gcc-trunk/gcc/dwarf2out.cc:32565
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-9077-20240220001758-g52490278466-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-9077-20240220001758-g52490278466-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240220 (experimental) (GCC)

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

* [Bug debug/114015] ICE: in build_abbrev_table, at dwarf2out.cc:9266 with -g -fvar-tracking-assignments -fdebug-types-section
  2024-02-20 18:50 [Bug debug/114015] New: ICE: in build_abbrev_table, at dwarf2out.cc:9266 with -g -fvar-tracking-assignments -fdebug-types-section zsojka at seznam dot cz
@ 2024-02-28 16:24 ` jakub at gcc dot gnu.org
  2024-03-01 13:58 ` cvs-commit at gcc dot gnu.org
  2024-03-01 14:01 ` jakub at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-02-28 16:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-02-28
             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 57568
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57568&action=edit
gcc14-pr114015.patch

Untested fix.

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

* [Bug debug/114015] ICE: in build_abbrev_table, at dwarf2out.cc:9266 with -g -fvar-tracking-assignments -fdebug-types-section
  2024-02-20 18:50 [Bug debug/114015] New: ICE: in build_abbrev_table, at dwarf2out.cc:9266 with -g -fvar-tracking-assignments -fdebug-types-section zsojka at seznam dot cz
  2024-02-28 16:24 ` [Bug debug/114015] " jakub at gcc dot gnu.org
@ 2024-03-01 13:58 ` cvs-commit at gcc dot gnu.org
  2024-03-01 14:01 ` jakub at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-03-01 13:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:5b1fb8f8b4fe60745dece9b2f83c155c772ca66d

commit r14-9254-g5b1fb8f8b4fe60745dece9b2f83c155c772ca66d
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Mar 1 14:57:15 2024 +0100

    dwarf2out: Don't move variable sized aggregates to comdat [PR114015]

    The following testcase ICEs, because we decide to move that
    struct { char a[n]; } DW_TAG_structure_type into .debug_types section
    / DW_UT_type DWARF5 unit, but refer from there to a DW_TAG_variable
    (created artificially for the array bounds).
    Even with non-bitint, I think it is just wrong to use .debug_types
    section / DW_UT_type for something that uses DW_OP_fbreg and similar
    in it, things clearly dependent on a particular function.
    In most cases, is_nested_in_subprogram (die) check results in such
    aggregates not being moved, but in the function parameter type case
    that is not the case.

    The following patch fixes it by returning false from
should_move_die_to_comdat
    for non-constant sized aggregate types, i.e. when either we gave up on
    adding DW_AT_byte_size for it because it wasn't expressable, or when
    it is something non-constant (location description, reference, ...).

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

            PR debug/114015
            * dwarf2out.cc (should_move_die_to_comdat): Return false for
            aggregates without DW_AT_byte_size attribute or with non-constant
            DW_AT_byte_size.

            * gcc.dg/debug/dwarf2/pr114015.c: New test.

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

* [Bug debug/114015] ICE: in build_abbrev_table, at dwarf2out.cc:9266 with -g -fvar-tracking-assignments -fdebug-types-section
  2024-02-20 18:50 [Bug debug/114015] New: ICE: in build_abbrev_table, at dwarf2out.cc:9266 with -g -fvar-tracking-assignments -fdebug-types-section zsojka at seznam dot cz
  2024-02-28 16:24 ` [Bug debug/114015] " jakub at gcc dot gnu.org
  2024-03-01 13:58 ` cvs-commit at gcc dot gnu.org
@ 2024-03-01 14:01 ` jakub at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-03-01 14:01 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- 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:[~2024-03-01 14:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-20 18:50 [Bug debug/114015] New: ICE: in build_abbrev_table, at dwarf2out.cc:9266 with -g -fvar-tracking-assignments -fdebug-types-section zsojka at seznam dot cz
2024-02-28 16:24 ` [Bug debug/114015] " jakub at gcc dot gnu.org
2024-03-01 13:58 ` cvs-commit at gcc dot gnu.org
2024-03-01 14:01 ` 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).