This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, PR 61540] Do not ICE on impossible devirtualization


On Thu, Jun 19, 2014 at 12:49:55PM +0100, Martin Jambor wrote:
> Hi,
> 
> On Wed, Jun 18, 2014 at 06:12:34PM +0200, Bernhard Reutner-Fischer wrote:
> > On 18 June 2014 10:24:16 Martin Jambor <mjambor@suse.cz> wrote:
> > 
> > >@@ -3002,10 +3014,8 @@ try_make_edge_direct_virtual_call (struct
> > >cgraph_edge *ie,
> > >
> > >   if (target)
> > >     {
> > >-#ifdef ENABLE_CHECKING
> > >-      gcc_assert (possible_polymorphic_call_target_p
> > >-	 (ie, cgraph_get_node (target)));
> > >-#endif
> > >+      if (!possible_polymorphic_call_target_p (ie, cgraph_get_node (target)))
> > >+	return ipa_make_edge_direct_to_target (ie, target);
> > >       return ipa_make_edge_direct_to_target (ie, target);
> > >     }
> > 
> > The above looks odd. You return the same thing both conditionally
> > and unconditionally?
> > 
> 
> You are obviously right, apparently I was too tired to attempt to work
> that night.  Thanks, for spotting it.  The following patch has this
> corrected and it also passes bootstrap and testing on x86_64-linux on
> both the trunk and the 4.9 branch. OK for both?
> 
> Thanks,
> 
> Martin

Hi Martin,

This new test fails for test variants with -fPIC. ( trunk and gcc-4_9-branch )
I've confirmed this on ARM, AArch64 and x86_64.

  FAIL: g++.dg/ipa/pr61540.C -std=gnu++11  scan-ipa-dump cp "Type inconsident devirtualization"
  FAIL: g++.dg/ipa/pr61540.C -std=gnu++1y  scan-ipa-dump cp "Type inconsident devirtualization"
  FAIL: g++.dg/ipa/pr61540.C -std=gnu++98  scan-ipa-dump cp "Type inconsident devirtualization"

I don't understand enough of this area to be more helpful, but I've
attached the relevant dump and the generated assembly for x86_64 for this
command:

./cc1plus ../../src/gcc/gcc/testsuite/g++.dg/ipa/pr61540.C -fmessage-length=0 -std=gnu++98 -O3 -fno-early-inlining -fdump-ipa-cp -o foo.s -fPIC

Let me know if you need any patches testing, or if there is anything else
I can help with.

Thanks,
James

Attachment: foo.s
Description: Text document

Attachment: pr61540.C.045i.cp
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]