public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/65625] New: [5 Regression] ICE in make_typename_type, at cp/decl.c:3499
@ 2015-03-30 9:11 marxin at gcc dot gnu.org
2015-03-30 9:58 ` [Bug c++/65625] " marxin at gcc dot gnu.org
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2015-03-30 9:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65625
Bug ID: 65625
Summary: [5 Regression] ICE in make_typename_type, at
cp/decl.c:3499
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: marxin at gcc dot gnu.org
Hello.
$ g++ --version
g++ (GCC) 5.0.0 20150330 (experimental)
$ cat 1.ii
namespace std {
template <typename> int declval;
typename std::declval<>
$ g++ -std=gnu++1y 1.ii
1.ii:3:15: internal compiler error: in make_typename_type, at cp/decl.c:3499
typename std::declval<>
^
0x63d9cc make_typename_type(tree_node*, tree_node*, tag_types, int)
../../gcc/cp/decl.c:3499
0x6b13e1 cp_parser_elaborated_type_specifier
../../gcc/cp/parser.c:15439
0x6982a6 cp_parser_type_specifier
../../gcc/cp/parser.c:14754
0x6a9db1 cp_parser_decl_specifier_seq
../../gcc/cp/parser.c:11957
0x6b83c1 cp_parser_simple_declaration
../../gcc/cp/parser.c:11534
0x6b2280 cp_parser_block_declaration
../../gcc/cp/parser.c:11481
0x6bb73b cp_parser_declaration
../../gcc/cp/parser.c:11378
0x6b9ecd cp_parser_declaration_seq_opt
../../gcc/cp/parser.c:11264
0x6ba658 cp_parser_namespace_body
../../gcc/cp/parser.c:16268
0x6ba658 cp_parser_namespace_definition
../../gcc/cp/parser.c:16249
0x6bb6ad cp_parser_declaration
../../gcc/cp/parser.c:11366
0x6b9ecd cp_parser_declaration_seq_opt
../../gcc/cp/parser.c:11264
0x6ba1d3 cp_parser_translation_unit
../../gcc/cp/parser.c:4100
0x6ba1d3 c_parse_file()
../../gcc/cp/parser.c:33192
0x771392 c_common_parse_file()
../../gcc/c-family/c-opts.c:1057
Thanks,
Martin
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/65625] [5 Regression] ICE in make_typename_type, at cp/decl.c:3499
2015-03-30 9:11 [Bug c++/65625] New: [5 Regression] ICE in make_typename_type, at cp/decl.c:3499 marxin at gcc dot gnu.org
2015-03-30 9:58 ` [Bug c++/65625] " marxin at gcc dot gnu.org
@ 2015-03-30 9:58 ` rguenth at gcc dot gnu.org
2015-03-30 17:30 ` mpolacek at gcc dot gnu.org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-03-30 9:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65625
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-invalid-code
Target Milestone|--- |5.0
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Can you make the testcase valid and still ICE?
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/65625] [5 Regression] ICE in make_typename_type, at cp/decl.c:3499
2015-03-30 9:11 [Bug c++/65625] New: [5 Regression] ICE in make_typename_type, at cp/decl.c:3499 marxin at gcc dot gnu.org
@ 2015-03-30 9:58 ` marxin at gcc dot gnu.org
2015-03-30 9:58 ` rguenth at gcc dot gnu.org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2015-03-30 9:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65625
--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #1)
> Can you make the testcase valid and still ICE?
The issue is caused just in case of invalid code.
Martin
>From gcc-bugs-return-482233-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Mar 30 09:22:11 2015
Return-Path: <gcc-bugs-return-482233-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 5137 invoked by alias); 30 Mar 2015 09:22:11 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 5104 invoked by uid 48); 30 Mar 2015 09:22:08 -0000
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/65625] [5 Regression] ICE in make_typename_type, at cp/decl.c:3499
Date: Mon, 30 Mar 2015 10:04:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords: ice-on-invalid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: marxin at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-65625-4-c1LJyzyDbZ@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65625-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65625-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-03/txt/msg03377.txt.bz2
Content-length: 643
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65625
--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
g++ 4.8.3 output:
/home/marxin/Programming/seastar/1.ii:3:26: error: template declaration of ‘int
std::declval’
template <typename> int declval;
^
/home/marxin/Programming/seastar/1.ii:5:16: error: ‘declval’ in namespace ‘std’
does not name a type
typename std::declval<int> a;
^
/home/marxin/Programming/seastar/1.ii:5:23: error: expected unqualified-id
before ‘<’ token
typename std::declval<int> a;
>From gcc-bugs-return-482234-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Mar 30 09:33:51 2015
Return-Path: <gcc-bugs-return-482234-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 83933 invoked by alias); 30 Mar 2015 09:33:51 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 83864 invoked by uid 48); 30 Mar 2015 09:33:47 -0000
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/65610] [5 Regression] Compare debug failure with -g3 -fsanitize=undefined -fno-sanitize=vptr -O3
Date: Mon, 30 Mar 2015 10:12:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jakub at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-65610-4-OA2kS6oK8c@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65610-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65610-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-03/txt/msg03378.txt.bz2
Content-length: 4200
https://gcc.gnu.org/bugzilla/show_bug.cgi?ide610
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I've tried:
--- gcc/ipa-polymorphic-call.c.jj 2015-03-09 08:05:06.000000000 +0100
+++ gcc/ipa-polymorphic-call.c 2015-03-30 11:24:48.280199943 +0200
@@ -513,6 +513,38 @@ contains_type_p (tree outer_type, HOST_W
}
+/* Return a FUNCTION_DECL if BLOCK represents a constructor or destructor.
+ If CHECK_CLONES is true, also check for clones of ctor/dtors. */
+
+tree
+ctor_dtor_block_p (tree block, bool check_clones)
+{
+ tree fn = BLOCK_ABSTRACT_ORIGIN (block);
+ if (fn == NULL || TREE_CODE (fn) != FUNCTION_DECL)
+ return NULL_TREE;
+
+ if (TREE_CODE (TREE_TYPE (fn)) != METHOD_TYPE
+ || (!DECL_CXX_CONSTRUCTOR_P (fn) && !DECL_CXX_DESTRUCTOR_P (fn)))
+ {
+ if (!check_clones)
+ return NULL_TREE;
+
+ /* Watch for clones where we constant propagated the first
+ argument (pointer to the instance). */
+ fn = DECL_ABSTRACT_ORIGIN (fn);
+ if (!fn
+ || TREE_CODE (TREE_TYPE (fn)) != METHOD_TYPE
+ || (!DECL_CXX_CONSTRUCTOR_P (fn) && !DECL_CXX_DESTRUCTOR_P (fn)))
+ return NULL_TREE;
+ }
+
+ if (flags_from_decl_or_type (fn) & (ECF_PURE | ECF_CONST))
+ return NULL_TREE;
+
+ return fn;
+}
+
+
/* We know that the instance is stored in variable or parameter
(not dynamically allocated) and we want to disprove the fact
that it may be in construction at invocation of CALL.
@@ -552,28 +584,8 @@ decl_maybe_in_construction_p (tree base,
for (tree block = gimple_block (call); block && TREE_CODE (block) == BLOCK;
block = BLOCK_SUPERCONTEXT (block))
- if (BLOCK_ABSTRACT_ORIGIN (block)
- && TREE_CODE (BLOCK_ABSTRACT_ORIGIN (block)) == FUNCTION_DECL)
+ if (tree fn = ctor_dtor_block_p (block, !base || is_global_var (base)))
{
- tree fn = BLOCK_ABSTRACT_ORIGIN (block);
-
- if (TREE_CODE (TREE_TYPE (fn)) != METHOD_TYPE
- || (!DECL_CXX_CONSTRUCTOR_P (fn)
- && !DECL_CXX_DESTRUCTOR_P (fn)))
- {
- /* Watch for clones where we constant propagated the first
- argument (pointer to the instance). */
- fn = DECL_ABSTRACT_ORIGIN (fn);
- if (!fn
- || (base && !is_global_var (base))
- || TREE_CODE (TREE_TYPE (fn)) != METHOD_TYPE
- || (!DECL_CXX_CONSTRUCTOR_P (fn)
- && !DECL_CXX_DESTRUCTOR_P (fn)))
- continue;
- }
- if (flags_from_decl_or_type (fn) & (ECF_PURE | ECF_CONST))
- continue;
-
tree type = TYPE_MAIN_VARIANT (method_class_type (TREE_TYPE (fn)));
if (!outer_type || !types_odr_comparable (type, outer_type))
@@ -1163,15 +1175,7 @@ noncall_stmt_may_be_vtbl_ptr_store (gimp
block = BLOCK_SUPERCONTEXT (block))
if (BLOCK_ABSTRACT_ORIGIN (block)
&& TREE_CODE (BLOCK_ABSTRACT_ORIGIN (block)) == FUNCTION_DECL)
- {
- tree fn = BLOCK_ABSTRACT_ORIGIN (block);
-
- if (flags_from_decl_or_type (fn) & (ECF_PURE | ECF_CONST))
- return false;
- return (TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE
- && (DECL_CXX_CONSTRUCTOR_P (fn)
- || DECL_CXX_DESTRUCTOR_P (fn)));
- }
+ return ctor_dtor_block_p (block, false);
return (TREE_CODE (TREE_TYPE (current_function_decl)) == METHOD_TYPE
&& (DECL_CXX_CONSTRUCTOR_P (current_function_decl)
|| DECL_CXX_DESTRUCTOR_P (current_function_decl)));
which I hope doesn't change ipa-polymorphic-call.c behavior,
but before adjusting remove_unused_scope_block_p to also do
else if (!cfun->after_inlining && ctor_dtor_block_p (scope, true))
unused = false;
I've noticed that the noncall_stmt_may_be_vtbl_ptr_store call unfortunately
doesn't care just about the cdtor blocks, but about all blocks where
BLOCK_ABSTRACT_ORIGIN is a FUNCTION_DECL.
Preserving all such blocks would be too costly for -g0 I guess; wonder if we
e.g. could preserve in tree-ssa-live.c (!cfun->after_inlining ?) the
ctor_dtor_block_p (scope, true) and also pass a bool with the return of that
function down to the recursive remove_unused_scope_block_p calls and if that
flag is true, preserve the outermost scope with FUNCTION_DECL
block_abstract_origin there too.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/65625] [5 Regression] ICE in make_typename_type, at cp/decl.c:3499
2015-03-30 9:11 [Bug c++/65625] New: [5 Regression] ICE in make_typename_type, at cp/decl.c:3499 marxin at gcc dot gnu.org
2015-03-30 9:58 ` [Bug c++/65625] " marxin at gcc dot gnu.org
2015-03-30 9:58 ` rguenth at gcc dot gnu.org
@ 2015-03-30 17:30 ` mpolacek at gcc dot gnu.org
2015-03-31 13:20 ` rguenth at gcc dot gnu.org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-03-30 17:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65625
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-03-30
CC| |mpolacek at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Started with r214396.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/65625] [5 Regression] ICE in make_typename_type, at cp/decl.c:3499
2015-03-30 9:11 [Bug c++/65625] New: [5 Regression] ICE in make_typename_type, at cp/decl.c:3499 marxin at gcc dot gnu.org
` (2 preceding siblings ...)
2015-03-30 17:30 ` mpolacek at gcc dot gnu.org
@ 2015-03-31 13:20 ` rguenth at gcc dot gnu.org
2015-04-01 22:59 ` jason at gcc dot gnu.org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-03-31 13:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65625
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P1
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Not error-recovery -> P1.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/65625] [5 Regression] ICE in make_typename_type, at cp/decl.c:3499
2015-03-30 9:11 [Bug c++/65625] New: [5 Regression] ICE in make_typename_type, at cp/decl.c:3499 marxin at gcc dot gnu.org
` (3 preceding siblings ...)
2015-03-31 13:20 ` rguenth at gcc dot gnu.org
@ 2015-04-01 22:59 ` jason at gcc dot gnu.org
2015-04-01 23:00 ` jason at gcc dot gnu.org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2015-04-01 22:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65625
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/65625] [5 Regression] ICE in make_typename_type, at cp/decl.c:3499
2015-03-30 9:11 [Bug c++/65625] New: [5 Regression] ICE in make_typename_type, at cp/decl.c:3499 marxin at gcc dot gnu.org
` (4 preceding siblings ...)
2015-04-01 22:59 ` jason at gcc dot gnu.org
@ 2015-04-01 23:00 ` jason at gcc dot gnu.org
2015-04-02 16:43 ` jason at gcc dot gnu.org
2015-04-02 16:44 ` jason at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2015-04-01 23:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65625
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #5)
> Not error-recovery -> P1.
I would think P2, since the testcase is ill-formed.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/65625] [5 Regression] ICE in make_typename_type, at cp/decl.c:3499
2015-03-30 9:11 [Bug c++/65625] New: [5 Regression] ICE in make_typename_type, at cp/decl.c:3499 marxin at gcc dot gnu.org
` (5 preceding siblings ...)
2015-04-01 23:00 ` jason at gcc dot gnu.org
@ 2015-04-02 16:43 ` jason at gcc dot gnu.org
2015-04-02 16:44 ` jason at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2015-04-02 16:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65625
--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Thu Apr 2 16:43:02 2015
New Revision: 221842
URL: https://gcc.gnu.org/viewcvs?rev=221842&root=gcc&view=rev
Log:
PR c++/65625
* decl.c (make_typename_type): Handle seeing a variable template.
Added:
trunk/gcc/testsuite/g++.dg/cpp1y/var-templ23.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl.c
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/65625] [5 Regression] ICE in make_typename_type, at cp/decl.c:3499
2015-03-30 9:11 [Bug c++/65625] New: [5 Regression] ICE in make_typename_type, at cp/decl.c:3499 marxin at gcc dot gnu.org
` (6 preceding siblings ...)
2015-04-02 16:43 ` jason at gcc dot gnu.org
@ 2015-04-02 16:44 ` jason at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2015-04-02 16:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65625
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2015-04-02 16:44 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-30 9:11 [Bug c++/65625] New: [5 Regression] ICE in make_typename_type, at cp/decl.c:3499 marxin at gcc dot gnu.org
2015-03-30 9:58 ` [Bug c++/65625] " marxin at gcc dot gnu.org
2015-03-30 9:58 ` rguenth at gcc dot gnu.org
2015-03-30 17:30 ` mpolacek at gcc dot gnu.org
2015-03-31 13:20 ` rguenth at gcc dot gnu.org
2015-04-01 22:59 ` jason at gcc dot gnu.org
2015-04-01 23:00 ` jason at gcc dot gnu.org
2015-04-02 16:43 ` jason at gcc dot gnu.org
2015-04-02 16:44 ` 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).