unit that behaved thusly). So warn the user. */
else if (TREE_CODE (decl) == VAR_DECL
&& DECL_SECTION_NAME (decl) != NULL_TREE
- && DECL_INITIAL (decl) == NULL_TREE)
+ && DECL_INITIAL (decl) == NULL_TREE
+ && DECL_COMMON (decl)
+ && ! flag_no_common)
{
warning_with_decl (decl,
"section attribute ignored for uninitialized variable `%s'");
TREE_ASM_WRITTEN (decl) = 1;
- /* If storage size is erroneously variable, just continue.
- Error message was already made. */
+ app_disable ();
- if (DECL_SIZE (decl))
+ if (! dont_output_data)
{
if (TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST)
goto finish;
- app_disable ();
-
/* This is better than explicit arithmetic, since it avoids overflow. */
size_tree = size_binop (CEIL_DIV_EXPR,
- DECL_SIZE (decl), size_int (BITS_PER_UNIT));
+ DECL_SIZE (decl), size_int (BITS_PER_UNIT));
if (TREE_INT_CST_HIGH (size_tree) != 0)
{
{
if (DECL_INITIAL (decl))
/* Output the actual data. */
- output_constant (DECL_INITIAL (decl),
- int_size_in_bytes (TREE_TYPE (decl)));
+ output_constant (DECL_INITIAL (decl), TREE_INT_CST_LOW (size_tree));
else
/* Leave space for it. */
- assemble_zeros (int_size_in_bytes (TREE_TYPE (decl)));
+ assemble_zeros (TREE_INT_CST_LOW (size_tree));
}
finish:
{
switch (TREE_CODE (exp))
{
+ case ADDR_EXPR:
+ /* For ADDR_EXPR, we do not want to copy the decl whose address
+ is requested. We do want to copy constants though. */
+ if (TREE_CODE_CLASS (TREE_CODE (TREE_OPERAND (exp, 0))) == 'c')
+ return build1 (TREE_CODE (exp), TREE_TYPE (exp),
+ copy_constant (TREE_OPERAND (exp, 0)));
+ else
+ return copy_node (exp);
+
case INTEGER_CST:
case REAL_CST:
case STRING_CST:
- case ADDR_EXPR:
- /* For ADDR_EXPR, we do not want to copy the decl
- whose address is requested. */
return copy_node (exp);
case COMPLEX_CST:
unsigned char *buffer = (unsigned char *) alloca (size);
if (get_set_constructor_bytes (exp, buffer, size))
abort ();
- assemble_string (buffer, size);
+ assemble_string ((char *) buffer, size);
}
else
error ("unknown set constructor type");