part_type. Use MEM_SET_IN_STRUCT_P.
* expr.c (store_field): Handle CONCAT.
(store_constructor): Use fields_length.
* tree.c (fields_length): New fn.
* tree.h: Declare it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32514
138bc75d-0d04-0410-961f-
82ee72b054a4
+2000-03-13 Jason Merrill <jason@casey.cygnus.com>
+
+ * function.c (put_var_into_stack): Use type_for_mode to calculate
+ part_type. Use MEM_SET_IN_STRUCT_P.
+ * expr.c (store_field): Handle CONCAT.
+ (store_constructor): Use fields_length.
+ * tree.c (fields_length): New fn.
+ * tree.h: Declare it.
+
2000-03-13 Zack Weinberg <zack@wolery.cumb.org>
* Makefile.in (LIBCPP_OBJS): Add cpplex.o.
clear the whole structure first. */
else if (size > 0
&& ((list_length (CONSTRUCTOR_ELTS (exp))
- != list_length (TYPE_FIELDS (type)))
+ != fields_length (type))
|| mostly_zeros_p (exp)))
{
if (! cleared)
return blk_object;
}
+ if (GET_CODE (target) == CONCAT)
+ {
+ /* We're storing into a struct containing a single __complex. */
+
+ if (bitpos != 0)
+ abort ();
+ return store_expr (exp, target, 0);
+ }
+
/* If the structure is in a register or if the component
is a bit field, we cannot use addressing to access it.
Use bit-field techniques or SUBREG to store in it. */
/* A CONCAT contains two pseudos; put them both in the stack.
We do it so they end up consecutive. */
enum machine_mode part_mode = GET_MODE (XEXP (reg, 0));
- tree part_type = TREE_TYPE (TREE_TYPE (decl));
+ tree part_type = type_for_mode (part_mode, 0);
#ifdef FRAME_GROWS_DOWNWARD
/* Since part 0 should have a lower address, do it second. */
put_reg_into_stack (function, XEXP (reg, 1), part_type, part_mode,
PUT_CODE (reg, MEM);
MEM_VOLATILE_P (reg) = MEM_VOLATILE_P (XEXP (reg, 0));
MEM_ALIAS_SET (reg) = get_alias_set (decl);
+ MEM_SET_IN_STRUCT_P (reg, AGGREGATE_TYPE_P (TREE_TYPE (decl)));
/* The two parts are in memory order already.
Use the lower parts address as ours. */
return len;
}
+/* Returns the number of FIELD_DECLs in TYPE. */
+
+int
+fields_length (type)
+ tree type;
+{
+ tree t = TYPE_FIELDS (type);
+ int count = 0;
+
+ for (; t; t = TREE_CHAIN (t))
+ if (TREE_CODE (t) == FIELD_DECL)
+ ++count;
+
+ return count;
+}
+
/* Concatenate two chains of nodes (chained through TREE_CHAIN)
by modifying the last node in chain 1 to point to chain 2.
This is the Lisp primitive `nconc'. */
extern int list_length PARAMS ((tree));
+/* Returns the number of FIELD_DECLs in a type. */
+
+extern int fields_length PARAMS ((tree));
+
/* integer_zerop (tree x) is nonzero if X is an integer constant of value 0 */
extern int integer_zerop PARAMS ((tree));