[Bug c++/58627] [4.9 Regression] crash during compilation of boost testsuite

2013-12-29 Thread trippels at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58627

Markus Trippelsdorf trippels at gcc dot gnu.org changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 CC||trippels at gcc dot gnu.org
 Resolution|FIXED   |---

--- Comment #9 from Markus Trippelsdorf trippels at gcc dot gnu.org ---
I've re-run the boost-testsuite today and there were a number
of new ICEs. All turned out to be PCH related. For example 
(checking=release compiler):


...
==17975== Invalid read of size 8
==17975==at 0x504951: lookup_page_table_entry(void const*) [clone
.lto_priv.3354] (in /usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.0/cc1plus)
==17975==by 0xAEEE89: ggc_set_mark(void const*) (in
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.0/cc1plus)
==17975==by 0x12438A1: gt_ggc_mx_lang_tree_node(void*) (in
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.0/cc1plus)
==17975==by 0x1246A78: gt_ggc_mx_tree_statement_list_node(void*) (in
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.0/cc1plus)
==17975==by 0x1244EAE: gt_ggc_mx_lang_tree_node(void*) (in
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.0/cc1plus)
==17975==by 0x1243A5A: gt_ggc_mx_lang_tree_node(void*) (in
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.0/cc1plus)
==17975==by 0x1243A5A: gt_ggc_mx_lang_tree_node(void*) (in
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.0/cc1plus)
==17975==by 0x1243A5A: gt_ggc_mx_lang_tree_node(void*) (in
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.0/cc1plus)
==17975==by 0x1244EE9: gt_ggc_mx_lang_tree_node(void*) (in
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.0/cc1plus)
==17975==by 0x1244F29: gt_ggc_mx_lang_tree_node(void*) (in
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.0/cc1plus)
==17975==by 0x1243D11: gt_ggc_mx_lang_tree_node(void*) (in
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.0/cc1plus)
==17975==by 0x1246353: gt_ggc_mx_lang_decl(void*) (in
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.0/cc1plus)
==17975==  Address 0x80 is not stack'd, malloc'd or (recently) free'd
==17975== 
In file included from ../boost/throw_exception.hpp:39:0,
 from ../boost/smart_ptr/shared_ptr.hpp:31,
 from ../boost/shared_ptr.hpp:17,
 from ../boost/test/tools/assertion_result.hpp:24,
 from ../boost/test/tools/old/impl.hpp:20,
 from ../boost/test/test_tools.hpp:32,
 from ../boost/math/tools/test.hpp:16,
 from ../libs/math/test/pch_light.hpp:10:
../boost/exception/exception.hpp: In member function ‘void
boost::exception_detail::clone_implT::rethrow() const [with T =
boost::exception_detail::error_info_injectorstd::logic_error]’:
../boost/exception/exception.hpp:473:17: internal compiler error: Segmentation
fault
 }
 ^
Please submit a full bug report,
with preprocessed source if appropriate

[Bug c++/58627] [4.9 Regression] crash during compilation of boost testsuite

2013-12-29 Thread trippels at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58627

Markus Trippelsdorf trippels at gcc dot gnu.org changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #10 from Markus Trippelsdorf trippels at gcc dot gnu.org ---
Ah, I see PR59436 is more appropriate.


[Bug c++/58627] [4.9 Regression] crash during compilation of boost testsuite

2013-12-12 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58627

--- Comment #7 from Jakub Jelinek jakub at gcc dot gnu.org ---
Author: jakub
Date: Thu Dec 12 13:35:21 2013
New Revision: 205927

URL: http://gcc.gnu.org/viewcvs?rev=205927root=gccview=rev
Log:
PR c++/58627
* call.c (add_template_candidate_real): Don't call ggc_free on targs.

Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/class.c


[Bug c++/58627] [4.9 Regression] crash during compilation of boost testsuite

2013-12-12 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58627

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #8 from Jakub Jelinek jakub at gcc dot gnu.org ---
Fixed.


[Bug c++/58627] [4.9 Regression] crash during compilation of boost testsuite

2013-12-10 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58627

--- Comment #6 from Jakub Jelinek jakub at gcc dot gnu.org ---
Created attachment 31407
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=31407action=edit
gcc49-pr58627.patch

Untested fix.


[Bug c++/58627] [4.9 Regression] crash during compilation of boost testsuite

2013-12-09 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58627

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 CC||ubizjak at gmail dot com

--- Comment #5 from Paolo Carlini paolo.carlini at oracle dot com ---
*** Bug 59436 has been marked as a duplicate of this bug. ***


[Bug c++/58627] [4.9 Regression] crash during compilation of boost testsuite

2013-11-27 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58627

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2013-11-28
 CC||jakub at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #4 from Jakub Jelinek jakub at gcc dot gnu.org ---
Seems the crash is because we ggc_free (targs); but it is still reachable. 
While
pop_tinst_level has been called and thus it isn't reachable from
current_tinst_level, it is reachable from pending_templates
(in particular last_pending_template-tinst-next-next-decl is a TREE_LIST
with
TREE_VALUE set to the TREE_VEC targs we ggc_free).

fn_type_unification has:
  struct pending_template *old_last_pend = last_pending_template;
  struct tinst_level *old_error_tinst = last_error_tinst_level;
...
  /* We can't free this if a pending_template entry or last_error_tinst_level
 is pointing at it.  */
  if (last_pending_template == old_last_pend
   last_error_tinst_level == old_error_tinst)
ggc_free (tinst);
so it avoids ggc_free on tinst (the TREE_LIST with TREE_VALUE set to targs),
but unfortunately this technique isn't usable in the
resolve_address_of_overloaded_function caller, because last_pending_template
and
current_tinst_level are static vars in pt.c and this is in class.c.
So perhaps add some bool * argument to fn_type_unification through which it
could optionally tell the caller whether it is safe to ggc_free targs
(set to last_pending_template == old_last_pend  last_error_tinst_level ==
old_error_tinst if non-NULL)?  Jason?


[Bug c++/58627] [4.9 Regression] crash during compilation of boost testsuite

2013-11-05 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58627

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P1
Version|unknown |4.9.0


[Bug c++/58627] [4.9 Regression] crash during compilation of boost testsuite

2013-10-26 Thread octoploid at yandex dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58627

--- Comment #3 from octoploid at yandex dot com ---
Valgrind shows:

markus@x4 /tmp % valgrind --track-origins=yes --trace-children=yes g++ -O2
-std=c++11 -c test.ii
==6647== Memcheck, a memory error detector
==6647== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==6647== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==6647== Command: g++ -O2 -std=c++11 -c test.ii
==6647== 
==6647== Memcheck, a memory error detector
==6647== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==6647== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==6647== Command: /usr/x86_64-pc-linux-gnu/gcc-bin/4.9.0/g++ -O2 -std=c++11 -c
test.ii
==6647== 
==6655== Memcheck, a memory error detector
==6655== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==6655== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==6655== Command: /usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.0/cc1plus
-fpreprocessed test.ii -quiet -dumpbase test.ii -mtune=generic -march=x86-64
-auxbase test -O2 -std=c++11 -o /tmp/cctcTn3y.s
==6655== 
==6655== Invalid read of size 1
==6655==at 0x5E453A: gt_ggc_mx_lang_tree_node(void*) (c-common.h:1211)
==6655==by 0x5E5AEB: gt_ggc_mx_lang_tree_node(void*) (gt-cp-tree.h:510)
==6655==by 0x5E61AF: gt_ggc_mx_tinst_level(void*) (gt-cp-tree.h:124)
==6655==by 0x533E3F: gt_ggc_mx_pending_template(void*) (gt-cp-pt.h:44)
==6655==by 0x78A8E5: ggc_mark_root_tab(ggc_root_tab const*)
(ggc-common.c:133)
==6655==by 0x78AC90: ggc_mark_roots() (ggc-common.c:152)
==6655==by 0x65A9EA: ggc_collect() (ggc-page.c:2077)
==6655==by 0x869A4D: execute_one_pass(opt_pass*) (passes.c:2255)
==6655==by 0x869D65: execute_pass_list(opt_pass*) (passes.c:2267)
==6655==by 0x6AF0EB: analyze_function(cgraph_node*) (cgraphunit.c:650)
==6655==by 0x6B0127: analyze_functions() (cgraphunit.c:1004)
==6655==by 0x6B0F35: finalize_compilation_unit() (cgraphunit.c:2262)
==6655==  Address 0x17125d8 is not stack'd, malloc'd or (recently) free'd
==6655== 
test.ii: In function ‘void
fastest_itl_total_icl_quantifier_check_monoid_plus_4_bicremental_types_invoker()’:
test.ii:3069:14: internal compiler error: Segmentation fault
  static void
fastest_itl_total_icl_quantifier_check_monoid_plus_4_bicremental_types_invoker()
{ ::boost::unit_test::unit_test_log.set_checkpoint(
::boost::unit_test::const_string(
../libs/icl/test/fastest_total_icl_quantifier_/../fastest_total_icl_quantifier_cases.hpp,
sizeof(
../libs/icl/test/fastest_total_icl_quantifier_/../fastest_total_icl_quantifier_cases.hpp
) - 1 ), static_caststd::size_t(  15 
  ^
Please submit a full bug report,
with preprocessed source if appropriate.
See http://gcc.gnu.org/bugs.html for instructions.

[Bug c++/58627] [4.9 Regression] crash during compilation of boost testsuite

2013-10-10 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58627

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|--- |4.9.0


[Bug c++/58627] [4.9 Regression] crash during compilation of boost testsuite

2013-10-09 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58627

Markus Trippelsdorf markus at trippelsdorf dot de changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org
  Component|tree-optimization   |c++

--- Comment #2 from Markus Trippelsdorf markus at trippelsdorf dot de ---
Started with r198099.

The following patch apparently fixes the issue:

diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index c587e55ac681..9547da539c57 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -7436,7 +7436,6 @@ resolve_address_of_overloaded_function (tree target_type,
  if (same_type_p (target_fn_type, static_fn_type (instantiation)))
matches = tree_cons (instantiation, fn, matches);

- ggc_free (targs);
}

   /* Now, remove all but the most specialized of the matches.  */