Bug 83667 - ICE in dump_function_decl on a thunk with variadic arguments
Summary: ICE in dump_function_decl on a thunk with variadic arguments
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Nathan Sidwell
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2018-01-03 12:20 UTC by Martin Liška
Modified: 2018-01-08 12:52 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2018-01-03 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liška 2018-01-03 12:20:09 UTC
Very ancient bug, fails for all releases I have:

$ cat ice.cpp

struct a
{
  virtual ~a ();
};
struct b
{
  virtual void d (...);
};
struct : a, b
{
  void
  d (...)
  {
  }
} c;

$ ./xgcc -B. ice.cpp -fdump-ipa-inline
during IPA pass: inline
/home/marxin/Programming/testcases/ice.cpp:15:4: internal compiler error: Segmentation fault
 } c;
    ^
0x120ee31 crash_signal
	../../gcc/toplev.c:325
0x81e0d4 tree_check(tree_node*, char const*, int, char const*, tree_code)
	../../gcc/tree.h:3127
0x93d23a dump_function_decl
	../../gcc/cp/error.c:1604
0x93b36b dump_decl
	../../gcc/cp/error.c:1259
0x943e21 decl_as_string(tree_node*, int)
	../../gcc/cp/error.c:2956
0x943ef9 lang_decl_name(tree_node*, int, bool)
	../../gcc/cp/error.c:2990
0xae90a8 cxx_printable_name_internal
	../../gcc/cp/tree.c:2556
0xae9148 cxx_printable_name(tree_node*, int)
	../../gcc/cp/tree.c:2565
0xc60c85 symtab_node::name() const
	../../gcc/symtab.c:524
0xf4a057 ipa_dump_fn_summary(_IO_FILE*, cgraph_node*)
	../../gcc/ipa-fnsummary.c:889
0xf4a4eb ipa_dump_fn_summaries(_IO_FILE*)
	../../gcc/ipa-fnsummary.c:959
0x1db5621 ipa_inline
	../../gcc/ipa-inline.c:2370
0x1db667e execute
	../../gcc/ipa-inline.c:2855

   │1600      if (DECL_CLASS_SCOPE_P (t))
   │1601        cname = DECL_CONTEXT (t);
   │1602      /* This is for partially instantiated template methods.  */
   │1603      else if (TREE_CODE (fntype) == METHOD_TYPE)
  >│1604        cname = TREE_TYPE (TREE_VALUE (parmtypes));

parmtypes == 0

Nathan can you please take a look?

Martin
Comment 1 Nathan Sidwell 2018-01-03 16:02:02 UTC
Author: nathan
Date: Wed Jan  3 16:01:31 2018
New Revision: 256179

URL: https://gcc.gnu.org/viewcvs?rev=256179&root=gcc&view=rev
Log:
[PR c++/83667] Fix tree_dump ICE

https://gcc.gnu.org/ml/gcc-patches/2018-01/msg00148.html
	PR c++/83667
	* method.c (make_alias_for): Copy DECL_CONTEXT.

	PR c++/83667
	* g++.dg/ipa/pr83667.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/ipa/pr83667.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/method.c
    trunk/gcc/testsuite/ChangeLog
Comment 2 Nathan Sidwell 2018-01-03 16:02:33 UTC
Fixed r256179.
Comment 3 Nathan Sidwell 2018-01-04 15:49:59 UTC
Author: nathan
Date: Thu Jan  4 15:49:28 2018
New Revision: 256254

URL: https://gcc.gnu.org/viewcvs?rev=256254&root=gcc&view=rev
Log:
[PR c++/83667] Fix tree_dump ICE

https://gcc.gnu.org/ml/gcc-patches/2018-01/msg00218.html
	PR c++/83667
	* g++.dg/ipa/pr83667.C: Fix regex, require alias.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/ipa/pr83667.C
Comment 4 Martin Liška 2018-01-08 08:17:30 UTC
Thanks Nathan. Are you planning to backport that?
Comment 5 Nathan Sidwell 2018-01-08 12:52:44 UTC
No plan.  It's a p3 non-regression.