public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99108] New: ICE in ix86_get_function_versions_dispatcher, at config/i386/i386-features.c:2862
@ 2021-02-15 17:52 gscfq@t-online.de
  2021-02-15 17:54 ` [Bug c++/99108] " mpolacek at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: gscfq@t-online.de @ 2021-02-15 17:52 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99108
           Summary: ICE in ix86_get_function_versions_dispatcher, at
                    config/i386/i386-features.c:2862
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 (with -std=c++17) :


$ cat z1.cc
struct A {
  void foo(auto);
};
void A::foo(auto)
{
  int f(void) __attribute__((target("default")));
  int f(void) __attribute__((target("arch=atom")));
  int b = f();
}
void bar(void)
{
  A c;
  c.foo(7);
}


$ g++-11-20210214 -c z1.cc -std=c++2a
z1.cc: In instantiation of 'void A::foo(auto:2) [with auto:1 = int]':
z1.cc:13:10:   required from here
z1.cc:9:1: internal compiler error: in ix86_get_function_versions_dispatcher,
at config/i386/i386-features.c:2862
    9 | }
      | ^
0x1076533 ix86_get_function_versions_dispatcher(void*)
        ../../gcc/config/i386/i386-features.c:2862
0x667bdd get_function_version_dispatcher(tree_node*)
        ../../gcc/cp/call.c:8389
0x6b4fa5 cp_genericize_r
        ../../gcc/cp/cp-gimplify.c:1435
0xf64ee5 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ../../gcc/tree.c:12099
0x6b5795 cp_genericize_r
        ../../gcc/cp/cp-gimplify.c:1486
0xf64ee5 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ../../gcc/tree.c:12099
0x6b5a05 cp_genericize_r
        ../../gcc/cp/cp-gimplify.c:1178
0xf64ee5 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ../../gcc/tree.c:12099
0x6b45f8 cp_genericize_tree
        ../../gcc/cp/cp-gimplify.c:1604
0x6b4793 cp_genericize(tree_node*)
        ../../gcc/cp/cp-gimplify.c:1750
0x6dde47 finish_function(bool)
        ../../gcc/cp/decl.c:17470
0x7badde instantiate_body
        ../../gcc/cp/pt.c:25881
0x7bb9d0 instantiate_decl(tree_node*, bool, bool)
        ../../gcc/cp/pt.c:26151
0x7d5feb instantiate_pending_templates(int)
        ../../gcc/cp/pt.c:26230
0x6ecf72 c_parse_final_cleanups()
        ../../gcc/cp/decl2.c:4962

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

* [Bug c++/99108] ICE in ix86_get_function_versions_dispatcher, at config/i386/i386-features.c:2862
  2021-02-15 17:52 [Bug c++/99108] New: ICE in ix86_get_function_versions_dispatcher, at config/i386/i386-features.c:2862 gscfq@t-online.de
@ 2021-02-15 17:54 ` mpolacek at gcc dot gnu.org
  2021-02-16  7:26 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-02-15 17:54 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-02-15
             Status|UNCONFIRMED                 |NEW
                 CC|                            |mpolacek at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.

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

* [Bug c++/99108] ICE in ix86_get_function_versions_dispatcher, at config/i386/i386-features.c:2862
  2021-02-15 17:52 [Bug c++/99108] New: ICE in ix86_get_function_versions_dispatcher, at config/i386/i386-features.c:2862 gscfq@t-online.de
  2021-02-15 17:54 ` [Bug c++/99108] " mpolacek at gcc dot gnu.org
@ 2021-02-16  7:26 ` rguenth at gcc dot gnu.org
  2021-02-16  9:17 ` marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-02-16  7:26 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
So the issue here is likely that f() have not been finalized because they are
declared in local scope and thus there's no cgraph node for them (yet).

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

* [Bug c++/99108] ICE in ix86_get_function_versions_dispatcher, at config/i386/i386-features.c:2862
  2021-02-15 17:52 [Bug c++/99108] New: ICE in ix86_get_function_versions_dispatcher, at config/i386/i386-features.c:2862 gscfq@t-online.de
  2021-02-15 17:54 ` [Bug c++/99108] " mpolacek at gcc dot gnu.org
  2021-02-16  7:26 ` rguenth at gcc dot gnu.org
@ 2021-02-16  9:17 ` marxin at gcc dot gnu.org
  2021-03-16 14:54 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-02-16  9:17 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

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

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
I'll take care of it.

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

* [Bug c++/99108] ICE in ix86_get_function_versions_dispatcher, at config/i386/i386-features.c:2862
  2021-02-15 17:52 [Bug c++/99108] New: ICE in ix86_get_function_versions_dispatcher, at config/i386/i386-features.c:2862 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2021-02-16  9:17 ` marxin at gcc dot gnu.org
@ 2021-03-16 14:54 ` cvs-commit at gcc dot gnu.org
  2021-03-16 15:14 ` marxin at gcc dot gnu.org
  2021-03-16 20:17 ` jason at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-16 14:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:1c7bec8bfbc5457c1b57d0e3b67f5d6bc8812e57

commit r11-7693-g1c7bec8bfbc5457c1b57d0e3b67f5d6bc8812e57
Author: Martin Liska <mliska@suse.cz>
Date:   Wed Mar 3 09:38:55 2021 +0100

    c++: support target attr for DECL_LOCAL_DECL_P fns [PR99108]

    We crash when target attribute get_function_versions_dispatcher is called
    for a function that is not registered in call graph.  This was happening
    because we were calling it for the function-local decls that aren't in the
    symbol table, instead of the corresponding namespace-scope decls that are.

    gcc/cp/ChangeLog:

            PR c++/99108
            * call.c (get_function_version_dispatcher): Handle
            DECL_LOCAL_DECL_P.
            * decl.c (maybe_version_functions): Likewise.
            (maybe_mark_function_versioned): New.
            * name-lookup.c (push_local_extern_decl_alias): No longer static.
            * name-lookup.h (push_local_extern_decl_alias): Adjust.

    gcc/testsuite/ChangeLog:

            PR c++/99108
            * g++.target/i386/pr99108.C: New test.

    Co-authored-by: Jason Merrill <jason@redhat.com>

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

* [Bug c++/99108] ICE in ix86_get_function_versions_dispatcher, at config/i386/i386-features.c:2862
  2021-02-15 17:52 [Bug c++/99108] New: ICE in ix86_get_function_versions_dispatcher, at config/i386/i386-features.c:2862 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2021-03-16 14:54 ` cvs-commit at gcc dot gnu.org
@ 2021-03-16 15:14 ` marxin at gcc dot gnu.org
  2021-03-16 20:17 ` jason at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-03-16 15:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
@Jason: Do you tend to backport the fix? Or can we close as fixed?

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

* [Bug c++/99108] ICE in ix86_get_function_versions_dispatcher, at config/i386/i386-features.c:2862
  2021-02-15 17:52 [Bug c++/99108] New: ICE in ix86_get_function_versions_dispatcher, at config/i386/i386-features.c:2862 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2021-03-16 15:14 ` marxin at gcc dot gnu.org
@ 2021-03-16 20:17 ` jason at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2021-03-16 20:17 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED
   Target Milestone|---                         |11.0

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
I don't think this needs backporting, but could do if needed.  The workaround
of moving the declarations to namespace scope seems sufficient for older
compilers.

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

end of thread, other threads:[~2021-03-16 20:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-15 17:52 [Bug c++/99108] New: ICE in ix86_get_function_versions_dispatcher, at config/i386/i386-features.c:2862 gscfq@t-online.de
2021-02-15 17:54 ` [Bug c++/99108] " mpolacek at gcc dot gnu.org
2021-02-16  7:26 ` rguenth at gcc dot gnu.org
2021-02-16  9:17 ` marxin at gcc dot gnu.org
2021-03-16 14:54 ` cvs-commit at gcc dot gnu.org
2021-03-16 15:14 ` marxin at gcc dot gnu.org
2021-03-16 20:17 ` jason 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).