Patchwork [C++,/,RFC] PR 52432

login
register
mail settings
Submitter Paolo Carlini
Date Sept. 19, 2012, 3:55 p.m.
Message ID <5059EAF8.7030501@oracle.com>
Download mbox | patch
Permalink /patch/185090/
State New
Headers show

Comments

Paolo Carlini - Sept. 19, 2012, 3:55 p.m.
Hi all, Jason,

the large testcase attached by Jon to this PR triggers an "Internal 
compiler error: Error reporting routines re-entered." from 
-fdump-tree-gimple. The immediate cause seems obvious: in one place in 
tsubst_copy_and_build we are calling unqualified_name_lookup_error 
unconditionally, thus irrespective of complain. Changing that indeed 
avoids the ICE.

Then I come to the existing testcase which doesn't pass as-is: it's the 
testcase added by Jason as part of fixing 50075, which, as analyzed by 
Jason himself, was clearly about an endless recursion. Currently, 
however, we error out with that unqualified_name_lookup_error, once, and 
we don't mention the recursion in the error message. With the patchlet 
applied, the diagnostics actually shows the recursion, and we error out  
few lines above in tsubst_copy_and_build, with the error messages koenig 
lookup related. That makes some sense to me, but the testcase needs 
tweaking.

Thanks,
Paolo.

////////////////////////
Jason Merrill - Sept. 20, 2012, 4:08 a.m.
OK.

Jason
Paolo Carlini - Sept. 20, 2012, 10:58 a.m.
On 09/20/2012 06:08 AM, Jason Merrill wrote:
> OK.
Thanks Jason.

Unfortunately I can't apply the patch because apparently it triggers 
rather mysterious failures in the library testsuite, ICEs as Seg faults 
in 17_intro/headers/c++1998.

I have troubles debugging it because I can't reproduce outside the 
testsuite (apparently it requires the library PCHs), also, if I run the 
testsuite again after build & install the failures disappear. I even 
fear hardware problems on my machine. If somebody has the time to give 
the patchlet a try I would be curious to know if I'm alone in seeing 
such weird behaviors.

Thanks,
Paolo.
Paolo Carlini - Sept. 20, 2012, 11:06 a.m.
On 09/20/2012 12:58 PM, Paolo Carlini wrote:
> On 09/20/2012 06:08 AM, Jason Merrill wrote:
>> OK.
> Thanks Jason.
>
> Unfortunately I can't apply the patch because apparently it triggers 
> rather mysterious failures in the library testsuite, ICEs as Seg 
> faults in 17_intro/headers/c++1998.
Ah, ah, with today's mainline I see the weird failures also *without* 
the patch!

Let's see if somebody else is experiencing the same issue, or it's just 
something broken on my system.

Paolo.

Patch

Index: testsuite/g++.dg/cpp0x/decltype32.C
===================================================================
--- testsuite/g++.dg/cpp0x/decltype32.C	(revision 191479)
+++ testsuite/g++.dg/cpp0x/decltype32.C	(working copy)
@@ -3,10 +3,10 @@ 
 
 template <typename T>
 auto make_array(const T& il) ->
-decltype(make_array(il))	// { dg-error "not declared" }
+decltype(make_array(il))    // { dg-error "not declared|no matching|exceeds" }
 { }
 
 int main()
 {
-  int z = make_array(1);	// { dg-error "no match" }
+  int z = make_array(1);    // { dg-error "no matching" }
 }
Index: cp/pt.c
===================================================================
--- cp/pt.c	(revision 191483)
+++ cp/pt.c	(working copy)
@@ -13771,7 +13771,8 @@  tsubst_copy_and_build (tree t,
 	      }
 	    if (TREE_CODE (function) == IDENTIFIER_NODE)
 	      {
-		unqualified_name_lookup_error (function);
+		if (complain & tf_error)
+		  unqualified_name_lookup_error (function);
 		release_tree_vector (call_args);
 		RETURN (error_mark_node);
 	      }