m3-sys/m3cc/gcc-apple/gcc/varasm.c
/* Create the DECL_RTL for a VAR_DECL or FUNCTION_DECL.  DECL should
   have static storage duration.  In other words, it should not be an
   automatic variable, including PARM_DECLs.

   There is, however, one exception: this function handles variables
   explicitly placed in a particular register by the user.

   This is never called for PARM_DECL nodes.  */


There is, however, one exception: this function handles variables
explicitly placed in a particular register by the user.

This is never called for PARM_DECL nodes.
There is however one exception : this function handles variables explicitly placed in a particular register by the user . This is never called for PARM_DECL nodes .
void
make_decl_rtl (tree decl)
{
  const char *name = 0;
  int reg_number;
  rtx x;
  gcc_assert (TREE_CODE (decl) != PARM_DECL
	      && TREE_CODE (decl) != RESULT_DECL);
  gcc_assert (TREE_CODE (decl) != VAR_DECL
	      || TREE_STATIC (decl)
	      || TREE_PUBLIC (decl)
	      || DECL_EXTERNAL (decl)
	      || DECL_REGISTER (decl));
  gcc_assert (TREE_CODE (decl) != TYPE_DECL
	      && TREE_CODE (decl) != LABEL_DECL);
  if (DECL_RTL_SET_P (decl))
    {
      x = DECL_RTL (decl);
      if (GET_MODE (x) != DECL_MODE (decl))
	SET_DECL_RTL (decl, adjust_address_nv (x, DECL_MODE (decl), 0));
      if (TREE_CODE (decl) != FUNCTION_DECL && DECL_REGISTER (decl))
	return;
      targetm.encode_section_info (decl, DECL_RTL (decl), false);
      if (MEM_P (x)
	  && GET_CODE (XEXP (x, 0)) == SYMBOL_REF
	  && SYMBOL_REF_HAS_BLOCK_INFO_P (XEXP (x, 0)))
	change_symbol_block (XEXP (x, 0), get_block_for_decl (decl));
      if (flag_mudflap && TREE_CODE (decl) == VAR_DECL)
	mudflap_enqueue_decl (decl);
      return;
    }
  name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
  if (name[0] != '*' && TREE_CODE (decl) != FUNCTION_DECL
      && DECL_REGISTER (decl))
    {
      error ("register name not specified for %q+D", decl);
    }
  else if (TREE_CODE (decl) != FUNCTION_DECL && DECL_REGISTER (decl))
    {
      const char *asmspec = name+1;
      reg_number = decode_reg_name (asmspec);
      if (reg_number == -1)
	error ("register name not specified for %q+D", decl);
      else if (reg_number < 0)
	error ("invalid register name for %q+D", decl);
      else if (TYPE_MODE (TREE_TYPE (decl)) == BLKmode)
	error ("data type of %q+D isn%'t suitable for a register",
	       decl);
      else if (! HARD_REGNO_MODE_OK (reg_number, TYPE_MODE (TREE_TYPE (decl))))
	error ("register specified for %q+D isn%'t suitable for data type",
               decl);
      else
	{
	  int nregs;
	  if (DECL_INITIAL (decl) != 0 && TREE_STATIC (decl))
	    {
	      DECL_INITIAL (decl) = 0;
	      error ("global register variable has initial value");
	    }
	  if (TREE_THIS_VOLATILE (decl))
	    warning (OPT_Wvolatile_register_var,
		     "optimization may eliminate reads and/or "
		     "writes to register variables");
	  SET_DECL_RTL (decl, gen_rtx_raw_REG (DECL_MODE (decl), reg_number));
	  ORIGINAL_REGNO (DECL_RTL (decl)) = reg_number;
	  REG_USERVAR_P (DECL_RTL (decl)) = 1;
	  if (TREE_STATIC (decl))
	    {
#ifdef ASM_DECLARE_REGISTER_GLOBAL
	      name = IDENTIFIER_POINTER (DECL_NAME (decl));
	      ASM_DECLARE_REGISTER_GLOBAL (asm_out_file, decl, reg_number, name);
#endif
	      nregs = hard_regno_nregs[reg_number][DECL_MODE (decl)];
	      while (nregs > 0)
		globalize_reg (reg_number + --nregs);
	    }
	  return;
	}
    }
  else if (name[0] == '*')
  {
#ifdef REGISTER_PREFIX
    if (strlen (REGISTER_PREFIX) != 0)
      {
	reg_number = decode_reg_name (name);
	if (reg_number >= 0 || reg_number == -3)
	  error ("register name given for non-register variable %q+D", decl);
      }
#endif
  }
  if (TREE_CODE (decl) == VAR_DECL
      && DECL_SECTION_NAME (decl) != NULL_TREE
      && DECL_INITIAL (decl) == NULL_TREE
      && DECL_COMMON (decl))
    DECL_COMMON (decl) = 0;
  if (TREE_CODE (decl) == VAR_DECL && DECL_WEAK (decl))
    DECL_COMMON (decl) = 0;
  if (use_object_blocks_p () && use_blocks_for_decl_p (decl))
    x = create_block_symbol (name, get_block_for_decl (decl), -1);
  else
    x = gen_rtx_SYMBOL_REF (Pmode, name);
  SYMBOL_REF_WEAK (x) = DECL_WEAK (decl);
  SET_SYMBOL_REF_DECL (x, decl);
  x = gen_rtx_MEM (DECL_MODE (decl), x);
  if (TREE_CODE (decl) != FUNCTION_DECL)
    set_mem_attributes (x, decl, 1);
  SET_DECL_RTL (decl, x);
  targetm.encode_section_info (decl, DECL_RTL (decl), true);
  if (flag_mudflap && TREE_CODE (decl) == VAR_DECL)
    mudflap_enqueue_decl (decl);
}
void make_decl_rtl ( tree decl ) { const char * name = 0 ; int reg_number ; rtx x ; gcc_assert ( TREE_CODE ( decl ) != PARM_DECL && TREE_CODE ( decl ) != RESULT_DECL ) ; gcc_assert ( TREE_CODE ( decl ) != VAR_DECL || TREE_STATIC ( decl ) || TREE_PUBLIC ( decl ) || DECL_EXTERNAL ( decl ) || DECL_REGISTER ( decl ) ) ; gcc_assert ( TREE_CODE ( decl ) != TYPE_DECL && TREE_CODE ( decl ) != LABEL_DECL ) ; if ( DECL_RTL_SET_P ( decl ) ) { x = DECL_RTL ( decl ) ; if ( GET_MODE ( x ) != DECL_MODE ( decl ) ) SET_DECL_RTL ( decl , adjust_address_nv ( x , DECL_MODE ( decl ) , 0 ) ) ; if ( TREE_CODE ( decl ) != FUNCTION_DECL && DECL_REGISTER ( decl ) ) return ; targetm . encode_section_info ( decl , DECL_RTL ( decl ) , false ) ; if ( MEM_P ( x ) && GET_CODE ( XEXP ( x , 0 ) ) == SYMBOL_REF && SYMBOL_REF_HAS_BLOCK_INFO_P ( XEXP ( x , 0 ) ) ) change_symbol_block ( XEXP ( x , 0 ) , get_block_for_decl ( decl ) ) ; if ( flag_mudflap && TREE_CODE ( decl ) == VAR_DECL ) mudflap_enqueue_decl ( decl ) ; return ; } name = IDENTIFIER_POINTER ( DECL_ASSEMBLER_NAME ( decl ) ) ; if ( name [ 0 ] != ' ' && TREE_CODE ( decl ) != FUNCTION_DECL && DECL_REGISTER ( decl ) ) { error ( " " , decl ) ; } else if ( TREE_CODE ( decl ) != FUNCTION_DECL && DECL_REGISTER ( decl ) ) { const char * asmspec = name + 1 ; reg_number = decode_reg_name ( asmspec ) ; if ( reg_number == -1 ) error ( " " , decl ) ; else if ( reg_number < 0 ) error ( " " , decl ) ; else if ( TYPE_MODE ( TREE_TYPE ( decl ) ) == BLKmode ) error ( " " , decl ) ; else if ( ! HARD_REGNO_MODE_OK ( reg_number , TYPE_MODE ( TREE_TYPE ( decl ) ) ) ) error ( " " , decl ) ; else { int nregs ; if ( DECL_INITIAL ( decl ) != 0 && TREE_STATIC ( decl ) ) { DECL_INITIAL ( decl ) = 0 ; error ( " " ) ; } if ( TREE_THIS_VOLATILE ( decl ) ) warning ( OPT_Wvolatile_register_var , " " " " ) ; SET_DECL_RTL ( decl , gen_rtx_raw_REG ( DECL_MODE ( decl ) , reg_number ) ) ; ORIGINAL_REGNO ( DECL_RTL ( decl ) ) = reg_number ; REG_USERVAR_P ( DECL_RTL ( decl ) ) = 1 ; if ( TREE_STATIC ( decl ) ) { #ifdef ASM_DECLARE_REGISTER_GLOBAL name = IDENTIFIER_POINTER ( DECL_NAME ( decl ) ) ; ASM_DECLARE_REGISTER_GLOBAL ( asm_out_file , decl , reg_number , name ) ; #endif nregs = hard_regno_nregs [ reg_number ] [ DECL_MODE ( decl ) ] ; while ( nregs > 0 ) globalize_reg ( reg_number + -- nregs ) ; } return ; } } else if ( name [ 0 ] == ' ' ) { #ifdef REGISTER_PREFIX if ( strlen ( REGISTER_PREFIX ) != 0 ) { reg_number = decode_reg_name ( name ) ; if ( reg_number >= 0 || reg_number == -3 ) error ( " " , decl ) ; } #endif } if ( TREE_CODE ( decl ) == VAR_DECL && DECL_SECTION_NAME ( decl ) != NULL_TREE && DECL_INITIAL ( decl ) == NULL_TREE && DECL_COMMON ( decl ) ) DECL_COMMON ( decl ) = 0 ; if ( TREE_CODE ( decl ) == VAR_DECL && DECL_WEAK ( decl ) ) DECL_COMMON ( decl ) = 0 ; if ( use_object_blocks_p ( ) && use_blocks_for_decl_p ( decl ) ) x = create_block_symbol ( name , get_block_for_decl ( decl ) , -1 ) ; else x = gen_rtx_SYMBOL_REF ( Pmode , name ) ; SYMBOL_REF_WEAK ( x ) = DECL_WEAK ( decl ) ; SET_SYMBOL_REF_DECL ( x , decl ) ; x = gen_rtx_MEM ( DECL_MODE ( decl ) , x ) ; if ( TREE_CODE ( decl ) != FUNCTION_DECL ) set_mem_attributes ( x , decl , 1 ) ; SET_DECL_RTL ( decl , x ) ; targetm . encode_section_info ( decl , DECL_RTL ( decl ) , true ) ; if ( flag_mudflap && TREE_CODE ( decl ) == VAR_DECL ) mudflap_enqueue_decl ( decl ) ; }
Create the DECL_RTL for a VAR_DECL or FUNCTION_DECL.
Create the DECL_RTL for a VAR_DECL or FUNCTION_DECL .
/* Check that we are not being given an automatic variable.  */ /* A weak alias has TREE_PUBLIC set but not the other bits.  */ /* And that we were not given a type or a label.  */ /* For a duplicate declaration, we can be called twice on the
     same DECL node.  Don't discard the RTL already made.  */ /* If the old RTL had the wrong mode, fix the mode.  */ /* ??? Another way to do this would be to maintain a hashed
	 table of such critters.  Instead of adding stuff to a DECL
	 to give certain attributes to it, we could use an external
	 hash map from DECL to set of attributes.  */ /* Let the target reassign the RTL if it wants.
	 This is necessary, for example, when one machine specific
	 decl attribute overrides another.  */ /* If the symbol has a SYMBOL_REF_BLOCK field, update it based
	 on the new decl information.  */ /* Make this function static known to the mudflap runtime.  */ /* First detect errors in declaring global registers.  */ /* Now handle properly declared static register variables.  */ /* If the user specified one of the eliminables registers here,
	     e.g., FRAME_POINTER_REGNUM, we don't want to get this variable
	     confused with that register and be eliminated.  This usage is
	     somewhat suspect...  */ /* Make this register global, so not usable for anything
		 else.  */ /* As a register variable, it has no section.  */ /* Now handle ordinary static variables and functions (in memory).
     Also handle vars declared register invalidly.  */ /* Specifying a section attribute on a variable forces it into a
     non-.bss section, and thus it cannot be common.  */ /* Variables can't be both common and weak.  */ /* Optionally set flags or add text to the name to record information
     such as that it is a function name.
     If the name is changed, the macro ASM_OUTPUT_LABELREF
     will have to know how to strip this information.  */ /* Make this function static known to the mudflap runtime.  */