diff mbox

[committed] Typo in ipa-devirt.c

Message ID 20150727193535.GW3335@redhat.com
State New
Headers show

Commit Message

Marek Polacek July 27, 2015, 7:35 p.m. UTC
This patch fixes an obvious typo in types_same_for_odr detected by the
new -Wtautological-compare warning.

Bootstrapped/regtested on x86_64-linux, applying to trunk.

2015-07-27  Marek Polacek  <polacek@redhat.com>

	* ipa-devirt.c (types_same_for_odr): Fix typo.


	Marek

Comments

Richard Biener July 27, 2015, 7:45 p.m. UTC | #1
On July 27, 2015 9:35:35 PM GMT+02:00, Marek Polacek <polacek@redhat.com> wrote:
>This patch fixes an obvious typo in types_same_for_odr detected by the
>new -Wtautological-compare warning.
>
>Bootstrapped/regtested on x86_64-linux, applying to trunk.

Might want to back port this.  Looks like a latent wrong-code bug to me.

Richard.

>2015-07-27  Marek Polacek  <polacek@redhat.com>
>
>	* ipa-devirt.c (types_same_for_odr): Fix typo.
>
>diff --git gcc/ipa-devirt.c gcc/ipa-devirt.c
>index b7afc3b..0a92768 100644
>--- gcc/ipa-devirt.c
>+++ gcc/ipa-devirt.c
>@@ -550,7 +550,7 @@ types_same_for_odr (const_tree type1, const_tree
>type2, bool strict)
> 	return false;
>       if (TREE_CODE (type1) == RECORD_TYPE
> 	  && (TYPE_BINFO (type1) == NULL_TREE)
>-	      != (TYPE_BINFO (type1) == NULL_TREE))
>+	      != (TYPE_BINFO (type2) == NULL_TREE))
> 	return false;
>       if (TREE_CODE (type1) == RECORD_TYPE && TYPE_BINFO (type1)
> 	  && (BINFO_VTABLE (TYPE_BINFO (type1)) == NULL_TREE)
>
>	Marek
Marek Polacek July 27, 2015, 7:51 p.m. UTC | #2
On Mon, Jul 27, 2015 at 09:45:19PM +0200, Richard Biener wrote:
> On July 27, 2015 9:35:35 PM GMT+02:00, Marek Polacek <polacek@redhat.com> wrote:
> >This patch fixes an obvious typo in types_same_for_odr detected by the
> >new -Wtautological-compare warning.
> >
> >Bootstrapped/regtested on x86_64-linux, applying to trunk.
> 
> Might want to back port this.  Looks like a latent wrong-code bug to me.

Yeah, I'm going to put this into 5 as well.  4.9 probably doesn't have
this problem.

	Marek
diff mbox

Patch

diff --git gcc/ipa-devirt.c gcc/ipa-devirt.c
index b7afc3b..0a92768 100644
--- gcc/ipa-devirt.c
+++ gcc/ipa-devirt.c
@@ -550,7 +550,7 @@  types_same_for_odr (const_tree type1, const_tree type2, bool strict)
 	return false;
       if (TREE_CODE (type1) == RECORD_TYPE
 	  && (TYPE_BINFO (type1) == NULL_TREE)
-	      != (TYPE_BINFO (type1) == NULL_TREE))
+	      != (TYPE_BINFO (type2) == NULL_TREE))
 	return false;
       if (TREE_CODE (type1) == RECORD_TYPE && TYPE_BINFO (type1)
 	  && (BINFO_VTABLE (TYPE_BINFO (type1)) == NULL_TREE)