]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport r259429
authorMartin Liska <mliska@suse.cz>
Wed, 25 Apr 2018 07:41:25 +0000 (09:41 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Wed, 25 Apr 2018 07:41:25 +0000 (07:41 +0000)
2018-04-25  Martin Liska  <mliska@suse.cz>

Backport from mainline
2018-04-17  Jan Hubicka  <jh@suse.cz>

PR lto/85405
* ipa-devirt.c (odr_types_equivalent_p): Handle bit fields.

From-SVN: r259633

gcc/ChangeLog
gcc/ipa-devirt.c

index c75e50dbca0a7b5af053c56ec41bde8fc3168f8a..b7bb3d436f9dbd202c59070a1f3dd4b292a842da 100644 (file)
@@ -1,3 +1,11 @@
+2018-04-25  Martin Liska  <mliska@suse.cz>
+
+       Backport from mainline
+       2018-04-17  Jan Hubicka  <jh@suse.cz>
+
+       PR lto/85405
+       * ipa-devirt.c (odr_types_equivalent_p): Handle bit fields.
+
 2018-04-23  Aaron Sawdey  <acsawdey@linux.ibm.com>
 
        Backport from mainline
index 9853c4a499c2d7aaa7cb21d855f45f3e3a1b8210..b4d2a94858fd68a918e9b1a45f48e0abbd92f65e 100644 (file)
@@ -1576,8 +1576,15 @@ odr_types_equivalent_p (tree t1, tree t2, bool warn, bool *warned,
                                 "in another translation unit"));
                    return false;
                  }
-               gcc_assert (DECL_NONADDRESSABLE_P (f1)
-                           == DECL_NONADDRESSABLE_P (f2));
+               if (DECL_BIT_FIELD (f1) != DECL_BIT_FIELD (f2))
+                 {
+                   warn_odr (t1, t2, f1, f2, warn, warned,
+                             G_ ("one field is bitfield while other is not "));
+                   return false;
+                 }
+               else
+                 gcc_assert (DECL_NONADDRESSABLE_P (f1)
+                             == DECL_NONADDRESSABLE_P (f2));
              }
 
            /* If one aggregate has more fields than the other, they