PR tree-opt/23402
* gcc.c-torture/compile/zero-strct-3.c: New test.
* gcc.c-torture/compile/zero-strct-4.c: New test.
2005-08-16 Andrew Pinski <pinskia@physics.uc.edu>
PR tree-opt/23402
* gimplify.c (zero_sized_type): New function.
(gimplify_modify_expr_rhs): If we have a zero sized type,
replace the statement with an empty statement.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103191
138bc75d-0d04-0410-961f-
82ee72b054a4
+2005-08-16 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR tree-opt/23402
+ * gimplify.c (zero_sized_type): New function.
+ (gimplify_modify_expr_rhs): If we have a zero sized type,
+ replace the statement with an empty statement.
+
2005-08-16 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/crtfastmath.c (set_fast_math): Add "=m" for
return false;
}
+/* Return true if TYPE is zero sized. */
+
+static bool
+zero_sized_type (tree type)
+{
+ if (AGGREGATE_TYPE_P (type) && TYPE_SIZE (type)
+ && integer_zerop (TYPE_SIZE (type)))
+ return true;
+ return false;
+}
+
/* A subroutine of gimplify_init_constructor. Generate individual
MODIFY_EXPRs for a CONSTRUCTOR. OBJECT is the LHS against which the
assignments should happen. ELTS is the CONSTRUCTOR_ELTS of the
tree *post_p, bool want_value)
{
enum gimplify_status ret = GS_OK;
+ tree type = TREE_TYPE (*from_p);
+ if (zero_sized_type (type))
+ {
+ *expr_p = NULL_TREE;
+ return GS_ALL_DONE;
+ }
while (ret != GS_UNHANDLED)
switch (TREE_CODE (*from_p))
+2005-08-16 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR tree-opt/23402
+ * gcc.c-torture/compile/zero-strct-3.c: New test.
+ * gcc.c-torture/compile/zero-strct-4.c: New test.
+
2005-08-16 Steven Bosscher <stevenb@suse.de>
PR target/23376
--- /dev/null
+typedef struct {} spinlock_t;
+struct sk_buff_head {
+ int i;
+ spinlock_t lock;
+};
+struct sk_buff_head audit_skb_queue;
+void audit_init(void)
+{
+ struct sk_buff_head *list = &audit_skb_queue;
+ spinlock_t a = {};
+ audit_skb_queue.lock = a;
+}
--- /dev/null
+typedef struct {} raw_spinlock_t;
+typedef struct {
+ raw_spinlock_t raw_lock;
+} spinlock_t;
+struct sk_buff_head {
+ int i;
+ spinlock_t lock;
+};
+struct sk_buff_head audit_skb_queue;
+void audit_init(void)
+{
+ struct sk_buff_head *list = &audit_skb_queue;
+ audit_skb_queue.lock = (spinlock_t) { .raw_lock = { } };
+}