diff mbox

Fix thinko in handle_alias_pairs (PR c/61271)

Message ID 20140819102548.GG11974@redhat.com
State New
Headers show

Commit Message

Marek Polacek Aug. 19, 2014, 10:25 a.m. UTC
handle_alias_pairs contains the following thinko.
I believe it should be "not a virtual function".

Bootstrapped/regtested on x86_64-linux, ok for trunk?

2014-08-19  Marek Polacek  <polacek@redhat.com>

	PR c/61271
	* cgraphunit.c (handle_alias_pairs): Fix condition.


	Marek

Comments

Richard Biener Aug. 19, 2014, 11:22 a.m. UTC | #1
On Tue, Aug 19, 2014 at 12:25 PM, Marek Polacek <polacek@redhat.com> wrote:
> handle_alias_pairs contains the following thinko.
> I believe it should be "not a virtual function".
>
> Bootstrapped/regtested on x86_64-linux, ok for trunk?

Ok.  Is only trunk affected?

Thanks,
Richard.

> 2014-08-19  Marek Polacek  <polacek@redhat.com>
>
>         PR c/61271
>         * cgraphunit.c (handle_alias_pairs): Fix condition.
>
> diff --git gcc/cgraphunit.c gcc/cgraphunit.c
> index d9acc65..2c2006b 100644
> --- gcc/cgraphunit.c
> +++ gcc/cgraphunit.c
> @@ -1171,7 +1171,7 @@ handle_alias_pairs (void)
>           /* We use local aliases for C++ thunks to force the tailcall
>              to bind locally.  This is a hack - to keep it working do
>              the following (which is not strictly correct).  */
> -         && (! TREE_CODE (target_node->decl) == FUNCTION_DECL
> +         && (TREE_CODE (target_node->decl) != FUNCTION_DECL
>               || ! DECL_VIRTUAL_P (target_node->decl))
>           && ! lookup_attribute ("weakref", DECL_ATTRIBUTES (p->decl)))
>         {
>
>         Marek
Marek Polacek Aug. 19, 2014, 11:31 a.m. UTC | #2
On Tue, Aug 19, 2014 at 01:22:20PM +0200, Richard Biener wrote:
> On Tue, Aug 19, 2014 at 12:25 PM, Marek Polacek <polacek@redhat.com> wrote:
> > handle_alias_pairs contains the following thinko.
> > I believe it should be "not a virtual function".
> >
> > Bootstrapped/regtested on x86_64-linux, ok for trunk?
> 
> Ok.  Is only trunk affected?

I see the same code in 4.9 and 4.8 as well - can I backport the patch there?

	Marek
Richard Biener Aug. 19, 2014, 11:35 a.m. UTC | #3
On Tue, Aug 19, 2014 at 1:31 PM, Marek Polacek <polacek@redhat.com> wrote:
> On Tue, Aug 19, 2014 at 01:22:20PM +0200, Richard Biener wrote:
>> On Tue, Aug 19, 2014 at 12:25 PM, Marek Polacek <polacek@redhat.com> wrote:
>> > handle_alias_pairs contains the following thinko.
>> > I believe it should be "not a virtual function".
>> >
>> > Bootstrapped/regtested on x86_64-linux, ok for trunk?
>>
>> Ok.  Is only trunk affected?
>
> I see the same code in 4.9 and 4.8 as well - can I backport the patch there?

Yes, I suggest to leave it on trunk for a while to catch fallout (you
never know...)

Thanks,
Richard.

>         Marek
Marek Polacek Aug. 19, 2014, 11:50 a.m. UTC | #4
On Tue, Aug 19, 2014 at 01:35:20PM +0200, Richard Biener wrote:
> On Tue, Aug 19, 2014 at 1:31 PM, Marek Polacek <polacek@redhat.com> wrote:
> > On Tue, Aug 19, 2014 at 01:22:20PM +0200, Richard Biener wrote:
> >> On Tue, Aug 19, 2014 at 12:25 PM, Marek Polacek <polacek@redhat.com> wrote:
> >> > handle_alias_pairs contains the following thinko.
> >> > I believe it should be "not a virtual function".
> >> >
> >> > Bootstrapped/regtested on x86_64-linux, ok for trunk?
> >>
> >> Ok.  Is only trunk affected?
> >
> > I see the same code in 4.9 and 4.8 as well - can I backport the patch there?
> 
> Yes, I suggest to leave it on trunk for a while to catch fallout (you
> never know...)

Sure, especially in the cgraph code...  I'll wait until next week or
so, thanks.

	Marek
Marek Polacek Sept. 1, 2014, 2:19 p.m. UTC | #5
On Tue, Aug 19, 2014 at 01:50:41PM +0200, Marek Polacek wrote:
> Sure, especially in the cgraph code...  I'll wait until next week or
> so, thanks.

I've backported to 4.8/4.9 now.

	Marek
diff mbox

Patch

diff --git gcc/cgraphunit.c gcc/cgraphunit.c
index d9acc65..2c2006b 100644
--- gcc/cgraphunit.c
+++ gcc/cgraphunit.c
@@ -1171,7 +1171,7 @@  handle_alias_pairs (void)
 	  /* We use local aliases for C++ thunks to force the tailcall
 	     to bind locally.  This is a hack - to keep it working do
 	     the following (which is not strictly correct).  */
-	  && (! TREE_CODE (target_node->decl) == FUNCTION_DECL
+	  && (TREE_CODE (target_node->decl) != FUNCTION_DECL
 	      || ! DECL_VIRTUAL_P (target_node->decl))
 	  && ! lookup_attribute ("weakref", DECL_ATTRIBUTES (p->decl)))
 	{