public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/101975] New: ICE with '-g' for x86 named address spaces
@ 2021-08-19 10:41 tschwinge at gcc dot gnu.org
  2021-08-19 11:26 ` [Bug debug/101975] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2021-08-19 10:41 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101975
           Summary: ICE with '-g' for x86 named address spaces
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tschwinge at gcc dot gnu.org
  Target Milestone: ---

Given:

    int __seg_fs f;
    int __seg_gs g;

..., we ICE when compiling with '-g':

    [...]/pr.c:3:1: internal compiler error: in add_dwarf_attr, at
dwarf2out.c:4465
        3 | int __seg_fs f;
          | ^~~

This is for '{ dg-do compile { target i?86-*-* x86_64-*-* } }' -- I have not
verified if similar problem exist for other targets that support address
spaces.

    #0  fancy_abort (file=file@entry=0x1fe35a0
"[...]/source-gcc/gcc/dwarf2out.c", line=line@entry=4465,
function=function@entry=0x1fefba8 <add_dwarf_attr(die_struct*,
dw_attr_struct*)::__FUNCTION__> "add_dwarf_attr") at
[...]/source-gcc/gcc/diagnostic.c:1961
    #1  0x0000000000a221bb in add_dwarf_attr (attr=<synthetic pointer>,
die=0x7ffff768a230) at [...]/source-gcc/gcc/dwarf2out.c:4465
    #2  add_AT_string (str=<optimized out>, attr_kind=DW_AT_name,
die=0x7ffff768a230) at [...]/source-gcc/gcc/dwarf2out.c:4725
    #3  add_name_attribute (die=die@entry=0x7ffff768a230,
name_string=<optimized out>) at [...]/source-gcc/gcc/dwarf2out.c:21005
    #4  0x0000000000a46580 in add_name_attribute (name_string=<optimized out>,
die=0x7ffff768a230) at [...]/source-gcc/gcc/dwarf2out.c:21000
    #5  modified_type_die (type=<optimized out>, cv_quals=<optimized out>,
reverse=reverse@entry=false, context_die=context_die@entry=0x7ffff7565140) at
[...]/source-gcc/gcc/dwarf2out.c:13873
    #6  0x0000000000a47834 in add_type_attribute
(object_die=object_die@entry=0x7ffff768a1e0, type=<optimized out>,
type@entry=0x7ffff7674dc8, cv_quals=<optimized out>,
reverse=reverse@entry=false, context_die=context_die@entry=0x7ffff7565140) at
[...]/source-gcc/gcc/dwarf2out.c:22134
    #7  0x0000000000a3b5c5 in gen_variable_die (decl=decl@entry=0x7ffff7fc3b40,
origin=<optimized out>, origin@entry=0x0,
context_die=context_die@entry=0x7ffff7565140) at
[...]/source-gcc/gcc/dwarf2out.c:24446
    #8  0x0000000000a3c38d in gen_decl_die (decl=decl@entry=0x7ffff7fc3b40,
origin=origin@entry=0x0, ctx=ctx@entry=0x0,
context_die=context_die@entry=0x7ffff7565140) at
[...]/source-gcc/gcc/dwarf2out.c:26895
    #9  0x0000000000a3d277 in dwarf2out_decl (decl=decl@entry=0x7ffff7fc3b40)
at [...]/source-gcc/gcc/dwarf2out.c:27385
    #10 0x0000000000a3d50c in dwarf2out_early_global_decl (decl=0x7ffff7fc3b40)
at [...]/source-gcc/gcc/dwarf2out.c:27035
    #11 0x00000000007bc142 in finish_decl (decl=decl@entry=0x7ffff7fc3b40,
init_loc=init_loc@entry=0, init=<optimized out>, init@entry=0x0,
origtype=origtype@entry=0x0, asmspec_tree=asmspec_tree@entry=0x0) at
[...]/source-gcc/gcc/c/c-decl.c:5537
    #12 0x00000000008366bd in c_parser_declaration_or_fndef
(parser=parser@entry=0x7ffff7fc3ab0, fndef_ok=false, fndef_ok@entry=true,
static_assert_ok=static_assert_ok@entry=true, empty_ok=empty_ok@entry=true,
nested=nested@entry=false, start_attr_ok=start_attr_ok@entry=true,
objc_foreach_object_declaration=0x0, omp_declare_simd_clauses=0x0,
have_attrs=<optimized out>, attrs=0x0, oacc_routine_data=0x0,
fallthru_attr_p=0x0) at [...]/source-gcc/gcc/c/c-parser.c:2375
    #13 0x0000000000840888 in c_parser_external_declaration
(parser=0x7ffff7fc3ab0) at [...]/source-gcc/gcc/c/c-parser.c:1778
    #14 0x000000000084115a in c_parser_translation_unit (parser=<optimized
out>) at [...]/source-gcc/gcc/c/c-parser.c:1651
    #15 c_parse_file () at [...]/source-gcc/gcc/c/c-parser.c:22272
    #16 0x00000000008af54d in c_common_parse_file () at
[...]/source-gcc/gcc/c-family/c-opts.c:1223
    #17 0x0000000000f3c73a in compile_file () at
[...]/source-gcc/gcc/toplev.c:458
    #18 0x0000000000794d13 in do_compile () at
[...]/source-gcc/gcc/toplev.c:2233
    #19 toplev::main (this=this@entry=0x7fffffffcf10, argc=argc@entry=35,
argv=argv@entry=0x7fffffffd028) at [...]/source-gcc/gcc/toplev.c:2372
    #20 0x000000000079aa37 in main (argc=35, argv=0x7fffffffd028) at
[...]/source-gcc/gcc/main.c:39

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

* [Bug debug/101975] ICE with '-g' for x86 named address spaces
  2021-08-19 10:41 [Bug debug/101975] New: ICE with '-g' for x86 named address spaces tschwinge at gcc dot gnu.org
@ 2021-08-19 11:26 ` rguenth at gcc dot gnu.org
  2021-08-19 11:27 ` marxin at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-08-19 11:26 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |10.3.1, 11.2.1, 12.0
           Keywords|                            |ice-checking
   Last reconfirmed|                            |2021-08-19
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  Only happens with checking.  We add DW_AT_name twice.

13868     /* This probably indicates a bug.  */
13869     else if (mod_type_die && mod_type_die->die_tag == DW_TAG_base_type)
13870       {
13871         name = TYPE_IDENTIFIER (type);
13872         add_name_attribute (mod_type_die,
13873                             name ? IDENTIFIER_POINTER (name) :
"__unknown__");
13874       }

likely address-space qualifiers are not correctly handled when cv_quals is zero
but TYPE_QUALS includes address-space qualifiers (not sure if those should go
to the type die or to the variable die?).  It looks like address-spaces
are handled for pointed-to types in modified_type_die but that's all.

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

* [Bug debug/101975] ICE with '-g' for x86 named address spaces
  2021-08-19 10:41 [Bug debug/101975] New: ICE with '-g' for x86 named address spaces tschwinge at gcc dot gnu.org
  2021-08-19 11:26 ` [Bug debug/101975] " rguenth at gcc dot gnu.org
@ 2021-08-19 11:27 ` marxin at gcc dot gnu.org
  2021-08-19 11:28 ` [Bug debug/101975] [9/10/11/12 Regression] " rguenth at gcc dot gnu.org
  2021-08-19 16:43 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-08-19 11:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r8-4385-ga297ccb52e0c894e.

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

* [Bug debug/101975] [9/10/11/12 Regression] ICE with '-g' for x86 named address spaces
  2021-08-19 10:41 [Bug debug/101975] New: ICE with '-g' for x86 named address spaces tschwinge at gcc dot gnu.org
  2021-08-19 11:26 ` [Bug debug/101975] " rguenth at gcc dot gnu.org
  2021-08-19 11:27 ` marxin at gcc dot gnu.org
@ 2021-08-19 11:28 ` rguenth at gcc dot gnu.org
  2021-08-19 16:43 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-08-19 11:28 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ICE with '-g' for x86 named |[9/10/11/12 Regression] ICE
                   |address spaces              |with '-g' for x86 named
                   |                            |address spaces
           Priority|P3                          |P2
   Target Milestone|---                         |9.5

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

* [Bug debug/101975] [9/10/11/12 Regression] ICE with '-g' for x86 named address spaces
  2021-08-19 10:41 [Bug debug/101975] New: ICE with '-g' for x86 named address spaces tschwinge at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-08-19 11:28 ` [Bug debug/101975] [9/10/11/12 Regression] " rguenth at gcc dot gnu.org
@ 2021-08-19 16:43 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-19 16:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|NEW                         |RESOLVED

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 100530.

*** This bug has been marked as a duplicate of bug 100530 ***

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

end of thread, other threads:[~2021-08-19 16:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19 10:41 [Bug debug/101975] New: ICE with '-g' for x86 named address spaces tschwinge at gcc dot gnu.org
2021-08-19 11:26 ` [Bug debug/101975] " rguenth at gcc dot gnu.org
2021-08-19 11:27 ` marxin at gcc dot gnu.org
2021-08-19 11:28 ` [Bug debug/101975] [9/10/11/12 Regression] " rguenth at gcc dot gnu.org
2021-08-19 16:43 ` 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).