Bug 87269 - [9 Regression] ICE in tsubst_copy, at cp/pt.c:15475 starting from r261802
Summary: [9 Regression] ICE in tsubst_copy, at cp/pt.c:15475 starting from r261802
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 9.0
: P3 normal
Target Milestone: 9.0
Assignee: Nathan Sidwell
URL:
Keywords: ice-on-valid-code
: 87463 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-09-10 12:19 UTC by Martin Liška
Modified: 2018-11-16 23:18 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work: 8.2.0
Known to fail: 9.0
Last reconfirmed: 2018-09-10 00:00:00


Attachments
unreduced test-case (558.10 KB, application/x-bzip)
2018-09-10 12:19 UTC, Martin Liška
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liška 2018-09-10 12:19:23 UTC
Created attachment 44675 [details]
unreduced test-case

Starting from the revision I see:

$ g++ ice.ii -c
In file included from /home/abuild/rpmbuild/BUILD/webkitgtk-2.22.0/Source/JavaScriptCore/API/JSCallbackObject.h:244,
                 from /home/abuild/rpmbuild/BUILD/webkitgtk-2.22.0/Source/JavaScriptCore/API/glib/JSAPIWrapperGlobalObject.cpp:30:
/home/abuild/rpmbuild/BUILD/webkitgtk-2.22.0/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h: In instantiation of ‘static JSC::EncodedJSValue JSC::JSCallbackObject<Parent>::callbackGetter(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName) [with Parent = JSC::JSAPIWrapperGlobalObject; JSC::EncodedJSValue = long int]’:
/home/abuild/rpmbuild/BUILD/webkitgtk-2.22.0/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h:162:21:   required from ‘static bool JSC::JSCallbackObject<Parent>::getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&) [with Parent = JSC::JSAPIWrapperGlobalObject]’
/home/abuild/rpmbuild/BUILD/webkitgtk-2.22.0/Source/JavaScriptCore/API/glib/JSAPIWrapperGlobalObject.cpp:57:429:   required from here
/home/abuild/rpmbuild/BUILD/webkitgtk-2.22.0/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h:700:83: internal compiler error: in tsubst_copy, at cp/pt.c:15513
0x645c85 tsubst_copy
	/home/marxin/Programming/gcc/gcc/cp/pt.c:15513
0x9f046f tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
	/home/marxin/Programming/gcc/gcc/cp/pt.c:19039
0x9ef398 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
	/home/marxin/Programming/gcc/gcc/cp/pt.c:18309
0x9ef4ac tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
	/home/marxin/Programming/gcc/gcc/cp/pt.c:18325
0x9ef4ac tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
	/home/marxin/Programming/gcc/gcc/cp/pt.c:18325
0x9ef4ac tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
	/home/marxin/Programming/gcc/gcc/cp/pt.c:18325
0x9d6fdb tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
	/home/marxin/Programming/gcc/gcc/cp/pt.c:17455
0x9d4099 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
	/home/marxin/Programming/gcc/gcc/cp/pt.c:16646
0x9d4b54 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
	/home/marxin/Programming/gcc/gcc/cp/pt.c:16636
0x9d3fd9 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
	/home/marxin/Programming/gcc/gcc/cp/pt.c:16939
0xa054ae instantiate_decl(tree_node*, bool, bool)
	/home/marxin/Programming/gcc/gcc/cp/pt.c:24099
0xa094fb instantiate_pending_templates(int)
	/home/marxin/Programming/gcc/gcc/cp/pt.c:24215
0x920408 c_parse_final_cleanups()
	/home/marxin/Programming/gcc/gcc/cp/decl2.c:4709

I'm going to reduce the test-case.
Comment 1 Martin Liška 2018-09-10 13:58:45 UTC
Reduced test-case:

$ cat ice2.ii
namespace {
void  operator"" a(const char *, unsigned long);
}
inline namespace b {
void operator"" a(unsigned long long );
}
namespace c {
struct d {
    using e = bool ;
    e f;
};
struct g {
    d h;
}                        ;
template < class > class i  {
    static const g k;
    static bool f();
};
template < class j > bool i< j >::f() {
    ""a;
}                      template <> const g i< int >::k {                       f};
}
Comment 2 Martin Liška 2018-10-08 07:13:14 UTC
Nathan any progress here please?
Comment 3 Martin Liška 2018-10-24 07:42:44 UTC
*** Bug 87463 has been marked as a duplicate of this bug. ***
Comment 4 Martin Liška 2018-11-06 08:49:30 UTC
Probably a related issue: PR87814.
Nathan can you please take a look?
Comment 5 Nathan Sidwell 2018-11-08 20:58:08 UTC
Martin, this isn't icing now.
Comment 6 Martin Liška 2018-11-09 08:09:14 UTC
I can still see it iceing:
https://godbolt.org/z/tvHnzW

Can you please also try the duplicate?
Comment 7 Martin Liška 2018-11-15 08:33:56 UTC
Nathan?
Comment 8 Nathan Sidwell 2018-11-16 15:02:27 UTC
Author: nathan
Date: Fri Nov 16 15:01:55 2018
New Revision: 266210

URL: https://gcc.gnu.org/viewcvs?rev=266210&root=gcc&view=rev
Log:
[PR c++/87269] Mark string operator overload in template defn.

https://gcc.gnu.org/ml/gcc-patches/2018-11/msg01458.html
	PR c++/87269
	* parser.c (lookup_literal_operator): Mark overload for keeping
	when inside template.  Refactor.

	* g++.dg/lookup/pr87269.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/lookup/pr87269.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog
Comment 9 Nathan Sidwell 2018-11-16 15:03:21 UTC
Fixed trunk.  87814 is different.
Comment 10 Jakub Jelinek 2018-11-16 23:18:44 UTC
Author: jakub
Date: Fri Nov 16 23:18:13 2018
New Revision: 266225

URL: https://gcc.gnu.org/viewcvs?rev=266225&root=gcc&view=rev
Log:
	PR c++/87269
	* g++.dg/lookup/pr87269.C (std::size_t): New typedef.
	(operator"" _a) Change unsigned long type to std::size_t.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/lookup/pr87269.C