FreeBSD/contrib/gcc/varasm.c
/* If block symbol SYMBOL has not yet been assigned an offset, place
   it at the end of its block.  */
If block symbol SYMBOL has not yet been assigned an offset, place
it at the end of its block.
If block symbol SYMBOL has not yet been assigned an offset place it at the end of its block .
void
place_block_symbol (rtx symbol)
{
  unsigned HOST_WIDE_INT size, mask, offset;
  struct constant_descriptor_rtx *desc;
  unsigned int alignment;
  struct object_block *block;
  tree decl;
  gcc_assert (SYMBOL_REF_BLOCK (symbol));
  if (SYMBOL_REF_BLOCK_OFFSET (symbol) >= 0)
    return;
  if (CONSTANT_POOL_ADDRESS_P (symbol))
    {
      desc = SYMBOL_REF_CONSTANT (symbol);
      alignment = desc->align;
      size = GET_MODE_SIZE (desc->mode);
    }
  else if (TREE_CONSTANT_POOL_ADDRESS_P (symbol))
    {
      decl = SYMBOL_REF_DECL (symbol);
      alignment = get_constant_alignment (decl);
      size = get_constant_size (decl);
    }
  else
    {
      decl = SYMBOL_REF_DECL (symbol);
      alignment = DECL_ALIGN (decl);
      size = tree_low_cst (DECL_SIZE_UNIT (decl), 1);
    }
  block = SYMBOL_REF_BLOCK (symbol);
  mask = alignment / BITS_PER_UNIT - 1;
  offset = (block->size + mask) & ~mask;
  SYMBOL_REF_BLOCK_OFFSET (symbol) = offset;
  block->alignment = MAX (block->alignment, alignment);
  block->size = offset + size;
  VEC_safe_push (rtx, gc, block->objects, symbol);
}
void place_block_symbol ( rtx symbol ) { unsigned HOST_WIDE_INT size , mask , offset ; struct constant_descriptor_rtx * desc ; unsigned int alignment ; struct object_block * block ; tree decl ; gcc_assert ( SYMBOL_REF_BLOCK ( symbol ) ) ; if ( SYMBOL_REF_BLOCK_OFFSET ( symbol ) >= 0 ) return ; if ( CONSTANT_POOL_ADDRESS_P ( symbol ) ) { desc = SYMBOL_REF_CONSTANT ( symbol ) ; alignment = desc -> align ; size = GET_MODE_SIZE ( desc -> mode ) ; } else if ( TREE_CONSTANT_POOL_ADDRESS_P ( symbol ) ) { decl = SYMBOL_REF_DECL ( symbol ) ; alignment = get_constant_alignment ( decl ) ; size = get_constant_size ( decl ) ; } else { decl = SYMBOL_REF_DECL ( symbol ) ; alignment = DECL_ALIGN ( decl ) ; size = tree_low_cst ( DECL_SIZE_UNIT ( decl ) , 1 ) ; } block = SYMBOL_REF_BLOCK ( symbol ) ; mask = alignment / BITS_PER_UNIT - 1 ; offset = ( block -> size + mask ) & ~ mask ; SYMBOL_REF_BLOCK_OFFSET ( symbol ) = offset ; block -> alignment = MAX ( block -> alignment , alignment ) ; block -> size = offset + size ; VEC_safe_push ( rtx , gc , block -> objects , symbol ) ; }
If block symbol SYMBOL has not yet been assigned an offset, place
it at the end of its block.
If block symbol SYMBOL has not yet been assigned an offset place it at the end of its block .
/* Work out the symbol's size and alignment.  */ /* Calculate the object's offset from the start of the block.  */ /* Record the block's new alignment and size.  */