public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58207] New: ICE in sort_constexpr_mem_initializers due to out of bounds vector access
@ 2013-08-20 21:59 tsaunders at mozilla dot com
2013-08-20 22:36 ` [Bug c++/58207] [4.8/4.9 Regression] " paolo.carlini at oracle dot com
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: tsaunders at mozilla dot com @ 2013-08-20 21:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58207
Bug ID: 58207
Summary: ICE in sort_constexpr_mem_initializers due to out of
bounds vector access
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: tsaunders at mozilla dot com
Created attachment 30680
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30680&action=edit
preprocessed and somewhat reduced test case
The attached test case causes an ICE after errors with xg++ (GCC) 4.9.0
20130817 (experimental) as well as with g++ 4.8.0 but not with g++ 4.7.2
#0 diagnostic_report_diagnostic (context=0x1823300
<global_diagnostic_context>, diagnostic=diagnostic@entry=0x7fffffffda00) at
../../gcc/gcc/diagnostic.c:757
location = 3464477
orig_diag_kind = DK_ICE
saved_format_spec = <optimized out>
#1 0x0000000000ffbf80 in internal_error (gmsgid=gmsgid@entry=0x13e2d6b "in %s,
at %s:%d") at ../../gcc/gcc/diagnostic.c:1127
diagnostic = {message = {format_spec = 0x13e2d6b "in %s, at %s:%d",
args_ptr = 0x7fffffffd9e8, err_no = 2, locus = 0x7ffff6974093
<__GI___libc_malloc+99>, x_data = 0x0}, location = 3464477, override_column =
0,
x_data = 0x0, kind = DK_ICE, option_index = 0}
ap = {{gp_offset = 8, fp_offset = 48, overflow_arg_area =
0x7fffffffdb00, reg_save_area = 0x7fffffffda40}}
__FUNCTION__ = "internal_error"
#2 0x0000000000ffa7f4 in fancy_abort (file=file@entry=0x109f4c0
"../../gcc/gcc/vec.h", line=line@entry=827, function=function@entry=0x10cf8a0
<_ZZN3vecI17constructor_elt_d5va_gc8vl_embedEixEjE12__FUNCTION__> "operator[]")
at ../../gcc/gcc/diagnostic.c:1181
No locals.
#3 0x00000000006be2b8 in vec<constructor_elt_d, va_gc, vl_embed>::operator[]
(ix=0, this=<optimized out>) at ../../gcc/gcc/vec.h:827
No locals.
#4 0x00000000006d6427 in operator[] (ix=<optimized out>, this=<optimized out>)
at ../../gcc/gcc/tree.h:4111
No locals.
#5 build_constexpr_constructor_member_initializers (body=<optimized out>,
type=0x7ffff5337bd0) at ../../gcc/gcc/cp/semantics.c:6207
vec = 0x7ffff5376e58
ok = <optimized out>
#6 massage_constexpr_body (fun=fun@entry=0x7ffff53c5300,
body=body@entry=0x7ffff53bbb10) at ../../gcc/gcc/cp/semantics.c:6280
__FUNCTION__ = "massage_constexpr_body"
#7 0x00000000006ddbb4 in register_constexpr_fundef
(fun=fun@entry=0x7ffff53c5300, body=0x7ffff53bbb10) at
../../gcc/gcc/cp/semantics.c:6384
entry = {decl = 0x7ffff53c5300, body = 0x2}
slot = <optimized out>
__FUNCTION__ = "register_constexpr_fundef"
#8 0x000000000057c058 in maybe_save_function_definition (fun=<optimized out>)
at ../../gcc/gcc/cp/decl.c:13761
No locals.
#9 finish_function (flags=flags@entry=3) at ../../gcc/gcc/cp/decl.c:13882
fndecl = 0x7ffff53c5300
fntype = 0x7ffff53c6000
ctype = 0x0
__FUNCTION__ = "finish_function"
inclass_inline = 1
#10 0x00000000006643be in cp_parser_function_definition_after_declarator
(parser=parser@entry=0x7ffff68d40b0, inline_p=inline_p@entry=true) at
../../gcc/gcc/cp/parser.c:22275
fn = <optimized out>
ctor_initializer_p = true
saved_in_unbraced_linkage_specification_p = false
saved_in_function_body = false
saved_num_template_parameter_lists = 0
#11 0x000000000064a09d in cp_parser_late_parsing_for_member
(member_function=<optimized out>, parser=0x7ffff68d40b0) at
../../gcc/gcc/cp/parser.c:22921
function_scope = 0x0
tokens = 0x7ffff538cbc0
#12 cp_parser_class_specifier_1 (parser=parser@entry=0x7ffff68d40b0) at
../../gcc/gcc/cp/parser.c:19014
decl = <optimized out>
pushed_scope = <optimized out>
e = <optimized out>
class_type = <optimized out>
ix = 3
nested_name_specifier_p = <optimized out>
saved_num_template_parameter_lists = <optimized out>
saved_in_function_body = <optimized out>
saved_in_unbraced_linkage_specification_p = <optimized out>
scope = <optimized out>
type = <optimized out>
in_switch_statement_p = <optimized out>
__FUNCTION__ = "cp_parser_class_specifier_1"
attributes = <optimized out>
in_statement = <optimized out>
old_scope = <optimized out>
closing_brace = <optimized out>
#13 0x000000000064c211 in cp_parser_class_specifier (parser=0x7ffff68d40b0) at
../../gcc/gcc/cp/parser.c:19038
ret = <optimized out>
#14 cp_parser_type_specifier (parser=parser@entry=0x7ffff68d40b0,
flags=flags@entry=1, decl_specs=decl_specs@entry=0x7fffffffdf00,
is_declaration=is_declaration@entry=true,
declares_class_or_enum=declares_class_or_enum@entry=0x7fffffffde7c,
is_cv_qualifier=is_cv_qualifier@entry=0x7fffffffde7b) at
../../gcc/gcc/cp/parser.c:14040
type_spec = 0x0
keyword = <optimized out>
ds = ds_last
#15 0x00000000006616ca in cp_parser_decl_specifier_seq
(parser=parser@entry=0x7ffff68d40b0, flags=flags@entry=1,
decl_specs=decl_specs@entry=0x7fffffffdf00,
declares_class_or_enum=declares_class_or_enum@entry=0x7fffffffdefc)
at ../../gcc/gcc/cp/parser.c:11283
decl_spec_declares_class_or_enum = 0
is_cv_qualifier = false
type_spec = <optimized out>
found_decl_spec = true
__FUNCTION__ = "cp_parser_decl_specifier_seq"
constructor_possible_p = <optimized out>
start_token = <optimized out>
ds = ds_last
#16 0x00000000006651aa in cp_parser_simple_declaration
(parser=parser@entry=0x7ffff68d40b0,
function_definition_allowed_p=function_definition_allowed_p@entry=true,
maybe_range_for_decl=maybe_range_for_decl@entry=0x0)
at ../../gcc/gcc/cp/parser.c:10873
decl_specifiers = {locations = {0 <repeats 22 times>}, type = 0x0,
attributes = 0x0, std_attributes = 0x0, redefined_builtin_type = 0x0,
storage_class = sc_none, type_definition_p = 0, multiple_types_p = 0,
conflicting_specifiers_p = 0, any_specifiers_p = 0,
any_type_specifiers_p = 0, explicit_int_p = 0, explicit_int128_p = 0,
explicit_char_p = 0, gnu_thread_keyword_p = 0}
declares_class_or_enum = 0
saw_declarator = <optimized out>
__FUNCTION__ = "cp_parser_simple_declaration"
#17 0x00000000006671b1 in cp_parser_block_declaration (parser=0x7ffff68d40b0,
statement_p=<optimized out>) at ../../gcc/gcc/cp/parser.c:10822
statement_p = <optimized out>
parser = 0x7ffff68d40b0
#18 0x000000000067022c in cp_parser_declaration
(parser=parser@entry=0x7ffff68d40b0) at ../../gcc/gcc/cp/parser.c:10719
token1 = <optimized out>
saved_pedantic = 0
token2 = <optimized out>
p = 0x18dba00
attributes = <optimized out>
#19 0x000000000066eefe in cp_parser_declaration_seq_opt
(parser=parser@entry=0x7ffff68d40b0) at ../../gcc/gcc/cp/parser.c:10605
No locals.
#20 0x000000000066f111 in cp_parser_namespace_body (parser=0x7ffff68d40b0) at
../../gcc/gcc/cp/parser.c:15528
No locals.
#21 cp_parser_namespace_definition (parser=0x7ffff68d40b0) at
../../gcc/gcc/cp/parser.c:15509
attribs = 0x0
__FUNCTION__ = "cp_parser_namespace_definition"
identifier = 0x7ffff6875058
has_visibility = false
is_inline = false
#22 0x000000000067019e in cp_parser_declaration
(parser=parser@entry=0x7ffff68d40b0) at ../../gcc/gcc/cp/parser.c:10707
token1 = {type = <optimized out>, keyword = RID_NAMESPACE, flags =
<optimized out>, pragma_kind = <optimized out>, implicit_extern_c = <optimized
out>, ambiguous_p = <optimized out>, purged_p = <optimized out>,
location = <optimized out>, u = {tree_check_value = <optimized out>,
value = <optimized out>}}
saved_pedantic = 0
token2 = {type = CPP_NAME, keyword = RID_MAX, flags = <optimized out>,
pragma_kind = <optimized out>, implicit_extern_c = <optimized out>, ambiguous_p
= <optimized out>, purged_p = <optimized out>,
location = <optimized out>, u = {tree_check_value = <optimized out>,
value = <optimized out>}}
p = 0x18dba00
attributes = 0x0
#23 0x000000000066eefe in cp_parser_declaration_seq_opt
(parser=parser@entry=0x7ffff68d40b0) at ../../gcc/gcc/cp/parser.c:10605
No locals.
#24 0x00000000006707b3 in cp_parser_translation_unit (parser=0x7ffff68d40b0) at
../../gcc/gcc/cp/parser.c:3930
success = <optimized out>
declarator_obstack_base = 0x18dba00
#25 c_parse_file () at ../../gcc/gcc/cp/parser.c:28829
already_called = true
#26 0x0000000000784375 in c_common_parse_file () at
../../gcc/gcc/c-family/c-opts.c:1046
i = 0
#27 0x0000000000af5c26 in compile_file () at ../../gcc/gcc/toplev.c:546
No locals.
#28 0x0000000000af7a38 in do_compile () at ../../gcc/gcc/toplev.c:1878
No locals.
#29 toplev_main (argc=3, argv=0x7fffffffe2b8) at ../../gcc/gcc/toplev.c:1954
No locals.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/58207] [4.8/4.9 Regression] ICE in sort_constexpr_mem_initializers due to out of bounds vector access
2013-08-20 21:59 [Bug c++/58207] New: ICE in sort_constexpr_mem_initializers due to out of bounds vector access tsaunders at mozilla dot com
@ 2013-08-20 22:36 ` paolo.carlini at oracle dot com
2013-08-28 9:21 ` rguenth at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-08-20 22:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58207
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-08-20
Blocks| |55004
Summary|ICE in |[4.8/4.9 Regression] ICE in
|sort_constexpr_mem_initiali |sort_constexpr_mem_initiali
|zers due to out of bounds |zers due to out of bounds
|vector access |vector access
Ever confirmed|0 |1
--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Confirmed.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/58207] [4.8/4.9 Regression] ICE in sort_constexpr_mem_initializers due to out of bounds vector access
2013-08-20 21:59 [Bug c++/58207] New: ICE in sort_constexpr_mem_initializers due to out of bounds vector access tsaunders at mozilla dot com
2013-08-20 22:36 ` [Bug c++/58207] [4.8/4.9 Regression] " paolo.carlini at oracle dot com
@ 2013-08-28 9:21 ` rguenth at gcc dot gnu.org
2013-09-09 11:24 ` jakub at gcc dot gnu.org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-08-28 9:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58207
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.8.2
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/58207] [4.8/4.9 Regression] ICE in sort_constexpr_mem_initializers due to out of bounds vector access
2013-08-20 21:59 [Bug c++/58207] New: ICE in sort_constexpr_mem_initializers due to out of bounds vector access tsaunders at mozilla dot com
2013-08-20 22:36 ` [Bug c++/58207] [4.8/4.9 Regression] " paolo.carlini at oracle dot com
2013-08-28 9:21 ` rguenth at gcc dot gnu.org
@ 2013-09-09 11:24 ` jakub at gcc dot gnu.org
2013-09-09 12:31 ` jakub at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-09-09 11:24 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58207
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Reduced testcase:
struct A
{
virtual bool foo ();
};
struct B : public A
{
constexpr B () : A (&::n) {}
};
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/58207] [4.8/4.9 Regression] ICE in sort_constexpr_mem_initializers due to out of bounds vector access
2013-08-20 21:59 [Bug c++/58207] New: ICE in sort_constexpr_mem_initializers due to out of bounds vector access tsaunders at mozilla dot com
` (2 preceding siblings ...)
2013-09-09 11:24 ` jakub at gcc dot gnu.org
@ 2013-09-09 12:31 ` jakub at gcc dot gnu.org
2013-10-09 20:34 ` [Bug c++/58207] [4.7/4.8/4.9 " reichelt at gcc dot gnu.org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-09-09 12:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58207
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |error-recovery
CC| |jason at gcc dot gnu.org
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r195986.
Another testcase that ICEs:
struct C
{
virtual bool foo ();
};
struct D : public C
{
constexpr D () : C (6) {}
};
Changing sort_constexpr_mem_initializers to stop searching at the end of vector
and in that case just assert errorcount > 0 and return v unmodified fixes those
ICEs, though it is kind of ugly.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/58207] [4.7/4.8/4.9 Regression] ICE in sort_constexpr_mem_initializers due to out of bounds vector access
2013-08-20 21:59 [Bug c++/58207] New: ICE in sort_constexpr_mem_initializers due to out of bounds vector access tsaunders at mozilla dot com
` (3 preceding siblings ...)
2013-09-09 12:31 ` jakub at gcc dot gnu.org
@ 2013-10-09 20:34 ` reichelt at gcc dot gnu.org
2013-10-30 13:31 ` rguenth at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: reichelt at gcc dot gnu.org @ 2013-10-09 20:34 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58207
Volker Reichelt <reichelt at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-invalid-code
Known to work| |4.5.0, 4.6.0, 4.7.0, 4.7.1,
| |4.7.2
Target Milestone|4.8.2 |4.7.4
Summary|[4.8/4.9 Regression] ICE in |[4.7/4.8/4.9 Regression]
|sort_constexpr_mem_initiali |ICE in
|zers due to out of bounds |sort_constexpr_mem_initiali
|vector access |zers due to out of bounds
| |vector access
Known to fail| |4.7.3, 4.8.0, 4.9.0
--- Comment #4 from Volker Reichelt <reichelt at gcc dot gnu.org> ---
It's actually a regression in GCC 4.7.3.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/58207] [4.7/4.8/4.9 Regression] ICE in sort_constexpr_mem_initializers due to out of bounds vector access
2013-08-20 21:59 [Bug c++/58207] New: ICE in sort_constexpr_mem_initializers due to out of bounds vector access tsaunders at mozilla dot com
` (4 preceding siblings ...)
2013-10-09 20:34 ` [Bug c++/58207] [4.7/4.8/4.9 " reichelt at gcc dot gnu.org
@ 2013-10-30 13:31 ` rguenth at gcc dot gnu.org
2014-04-04 18:00 ` paolo.carlini at oracle dot com
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-10-30 13:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58207
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P5
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/58207] [4.7/4.8/4.9 Regression] ICE in sort_constexpr_mem_initializers due to out of bounds vector access
2013-08-20 21:59 [Bug c++/58207] New: ICE in sort_constexpr_mem_initializers due to out of bounds vector access tsaunders at mozilla dot com
` (5 preceding siblings ...)
2013-10-30 13:31 ` rguenth at gcc dot gnu.org
@ 2014-04-04 18:00 ` paolo.carlini at oracle dot com
2014-04-04 20:12 ` paolo.carlini at oracle dot com
2014-04-04 20:12 ` paolo at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-04-04 18:00 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58207
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |paolo.carlini at oracle dot com
--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Mine.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/58207] [4.7/4.8/4.9 Regression] ICE in sort_constexpr_mem_initializers due to out of bounds vector access
2013-08-20 21:59 [Bug c++/58207] New: ICE in sort_constexpr_mem_initializers due to out of bounds vector access tsaunders at mozilla dot com
` (6 preceding siblings ...)
2014-04-04 18:00 ` paolo.carlini at oracle dot com
@ 2014-04-04 20:12 ` paolo.carlini at oracle dot com
2014-04-04 20:12 ` paolo at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-04-04 20:12 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58207
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
Assignee|paolo.carlini at oracle dot com |unassigned at gcc dot gnu.org
Target Milestone|4.7.4 |4.9.0
--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed for 4.9.0.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/58207] [4.7/4.8/4.9 Regression] ICE in sort_constexpr_mem_initializers due to out of bounds vector access
2013-08-20 21:59 [Bug c++/58207] New: ICE in sort_constexpr_mem_initializers due to out of bounds vector access tsaunders at mozilla dot com
` (7 preceding siblings ...)
2014-04-04 20:12 ` paolo.carlini at oracle dot com
@ 2014-04-04 20:12 ` paolo at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: paolo at gcc dot gnu.org @ 2014-04-04 20:12 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58207
--- Comment #6 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Fri Apr 4 20:11:47 2014
New Revision: 209128
URL: http://gcc.gnu.org/viewcvs?rev=209128&root=gcc&view=rev
Log:
/cp
2014-04-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58207
* semantics.c (sort_constexpr_mem_initializers): Robustify loop.
/testsuite
2014-04-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58207
* g++.dg/cpp0x/constexpr-ice15.C: New.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-ice15.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/semantics.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2014-04-04 20:12 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-20 21:59 [Bug c++/58207] New: ICE in sort_constexpr_mem_initializers due to out of bounds vector access tsaunders at mozilla dot com
2013-08-20 22:36 ` [Bug c++/58207] [4.8/4.9 Regression] " paolo.carlini at oracle dot com
2013-08-28 9:21 ` rguenth at gcc dot gnu.org
2013-09-09 11:24 ` jakub at gcc dot gnu.org
2013-09-09 12:31 ` jakub at gcc dot gnu.org
2013-10-09 20:34 ` [Bug c++/58207] [4.7/4.8/4.9 " reichelt at gcc dot gnu.org
2013-10-30 13:31 ` rguenth at gcc dot gnu.org
2014-04-04 18:00 ` paolo.carlini at oracle dot com
2014-04-04 20:12 ` paolo.carlini at oracle dot com
2014-04-04 20:12 ` paolo 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).