On 09/28/2017 11:49 AM, Jakub Jelinek wrote:

The following patch is the D_B_F_R part of the above.
Bootstrapped/regtested on top of the patch I've just posted, ok for trunk?

Looks good, a couple of nits. I think the bits out of the cp FE are sufficiently obvious given the cp changes.


c/
        * c-decl.c (grokfield): Use SET_DECL_C_BIT_FIELD here if
        with is non-NULL.
/with/width

--- gcc/c-family/c-attribs.c.jj 2017-09-18 20:48:53.731871226 +0200
+++ gcc/c-family/c-attribs.c    2017-09-19 09:51:21.928612658 +0200
@@ -426,7 +426,7 @@ handle_packed_attribute (tree *node, tre

--- gcc/cp/class.c.jj   2017-09-18 20:48:53.509873991 +0200
+++ gcc/cp/class.c      2017-09-19 10:31:35.435961690 +0200
@@ -3231,12 +3231,12 @@ check_bitfield_decl (tree field)
    tree w;
/* Extract the declared width of the bitfield, which has been
-     temporarily stashed in DECL_INITIAL.  */
-  w = DECL_INITIAL (field);
+     temporarily stashed in DECL_BIT_FIELD_REPRESENTATIVE.  */

While you're here, could you point the comment at grokbitfield?


+++ gcc/cp/decl2.c      2017-09-19 10:31:45.066839694 +0200
@@ -1042,7 +1047,8 @@ grokbitfield (const cp_declarator *decla
               TREE_TYPE (width));
        else
        {
-         DECL_INITIAL (value) = width;
+         /* Temporarily stash the width in DECL_BIT_FIELD_REPRESENTATIVE.  */

And likewise here point at ceheck_bitfield_decl? (answering the temporarily 'til when? question)

+++ gcc/objc/objc-act.c 2017-09-19 13:01:06.917412755 +0200
@@ -4602,8 +4602,14 @@ check_ivars (tree inter, tree imp)
        t1 = TREE_TYPE (intdecls); t2 = TREE_TYPE (impdecls);
if (!comptypes (t1, t2)
+#ifdef OBJCPLUS
+         || !tree_int_cst_equal (DECL_BIT_FIELD_REPRESENTATIVE (intdecls),
+                                 DECL_BIT_FIELD_REPRESENTATIVE (impdecls))
+#else
          || !tree_int_cst_equal (DECL_INITIAL (intdecls),
-                                 DECL_INITIAL (impdecls)))
+                                 DECL_INITIAL (impdecls))
+#endif

This is a little unfortunate. Feel like adding a cleanup task to the easy-projects wiki? You'll see I added a few I've been spotting.

ok for trunk.

nathan

--
Nathan Sidwell

Reply via email to