OSDN Git Service

2009-09-01 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Sep 2009 08:38:10 +0000 (08:38 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Sep 2009 08:38:10 +0000 (08:38 +0000)
* tree-flow.h (mark_addressable): Move declaration ...
* tree.h (mark_addressable): ... here.
* stmt.c (expand_asm_operands): Use mark_addressable, not
lang_hooks.mark_addressable.
* langhooks-def.h (LANG_HOOKS_INITIALIZER): Remove
LANG_HOOKS_MARK_ADDRESSABLE.
* langhooks.h (struct lang_hooks): Remove mark_addressable langhook.

* c-objc-common.h (LANG_HOOKS_MARK_ADDRESSABLE): Remove.

ada/
* gcc-interface/misc.c (LANG_HOOKS_MARK_ADDRESSABLE): Remove.

cp/
* cp-objcp-common.h (LANG_HOOKS_MARK_ADDRESSABLE): Remove.

fortran/
* f95-lang.c (gfc_mark_addressable): Remove.
(LANG_HOOKS_MARK_ADDRESSABLE): Likewise.

java/
* lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Remove.
* java-tree.h (java_mark_addressable): Likewise.
* typeck.c (java_mark_addressable): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151260 138bc75d-0d04-0410-961f-82ee72b054a4

17 files changed:
gcc/ChangeLog
gcc/ada/ChangeLog
gcc/ada/gcc-interface/misc.c
gcc/c-objc-common.h
gcc/cp/ChangeLog
gcc/cp/cp-objcp-common.h
gcc/fortran/ChangeLog
gcc/fortran/f95-lang.c
gcc/java/ChangeLog
gcc/java/java-tree.h
gcc/java/lang.c
gcc/java/typeck.c
gcc/langhooks-def.h
gcc/langhooks.h
gcc/stmt.c
gcc/tree-flow.h
gcc/tree.h

index 61edf90..9b1577c 100644 (file)
@@ -1,3 +1,14 @@
+2009-09-01  Richard Guenther  <rguenther@suse.de>
+
+       * tree-flow.h (mark_addressable): Move declaration ...
+       * tree.h (mark_addressable): ... here.
+       * stmt.c (expand_asm_operands): Use mark_addressable, not
+       lang_hooks.mark_addressable.
+       * langhooks-def.h (LANG_HOOKS_INITIALIZER): Remove
+       LANG_HOOKS_MARK_ADDRESSABLE.
+       * langhooks.h (struct lang_hooks): Remove mark_addressable langhook.
+       * c-objc-common.h (LANG_HOOKS_MARK_ADDRESSABLE): Remove.
+
 2009-08-31  Chris Demetriou  <cgd@google.com>
 
        * config/i386/i386.c (ix86_vectorize_builtin_conversion): Never
 2009-08-31  Chris Demetriou  <cgd@google.com>
 
        * config/i386/i386.c (ix86_vectorize_builtin_conversion): Never
index ede9b4d..1723e41 100644 (file)
@@ -1,3 +1,7 @@
+2009-09-01  Richard Guenther  <rguenther@suse.de>
+
+       * gcc-interface/misc.c (LANG_HOOKS_MARK_ADDRESSABLE): Remove.
+
 2009-08-25  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc-interface/trans.c (call_to_gnu): Tidy.
 2009-08-25  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc-interface/trans.c (call_to_gnu): Tidy.
index cc9eeaa..46e762f 100644 (file)
@@ -106,8 +106,6 @@ static void gnat_get_subrange_bounds        (const_tree, tree *, tree *);
 #define LANG_HOOKS_WRITE_GLOBALS       gnat_write_global_declarations
 #undef  LANG_HOOKS_GET_ALIAS_SET
 #define LANG_HOOKS_GET_ALIAS_SET       gnat_get_alias_set
 #define LANG_HOOKS_WRITE_GLOBALS       gnat_write_global_declarations
 #undef  LANG_HOOKS_GET_ALIAS_SET
 #define LANG_HOOKS_GET_ALIAS_SET       gnat_get_alias_set
-#undef  LANG_HOOKS_MARK_ADDRESSABLE
-#define LANG_HOOKS_MARK_ADDRESSABLE    gnat_mark_addressable
 #undef  LANG_HOOKS_PRINT_DECL
 #define LANG_HOOKS_PRINT_DECL          gnat_print_decl
 #undef  LANG_HOOKS_PRINT_TYPE
 #undef  LANG_HOOKS_PRINT_DECL
 #define LANG_HOOKS_PRINT_DECL          gnat_print_decl
 #undef  LANG_HOOKS_PRINT_TYPE
index e90236e..8408b9f 100644 (file)
@@ -40,8 +40,6 @@ along with GCC; see the file COPYING3.  If not see
 #define LANG_HOOKS_POST_OPTIONS c_common_post_options
 #undef LANG_HOOKS_GET_ALIAS_SET
 #define LANG_HOOKS_GET_ALIAS_SET c_common_get_alias_set
 #define LANG_HOOKS_POST_OPTIONS c_common_post_options
 #undef LANG_HOOKS_GET_ALIAS_SET
 #define LANG_HOOKS_GET_ALIAS_SET c_common_get_alias_set
-#undef LANG_HOOKS_MARK_ADDRESSABLE
-#define LANG_HOOKS_MARK_ADDRESSABLE c_mark_addressable
 #undef LANG_HOOKS_PARSE_FILE
 #define LANG_HOOKS_PARSE_FILE c_common_parse_file
 #undef LANG_HOOKS_FINISH_INCOMPLETE_DECL
 #undef LANG_HOOKS_PARSE_FILE
 #define LANG_HOOKS_PARSE_FILE c_common_parse_file
 #undef LANG_HOOKS_FINISH_INCOMPLETE_DECL
index fa5bc97..19c17be 100644 (file)
@@ -1,3 +1,7 @@
+2009-09-01  Richard Guenther  <rguenther@suse.de>
+
+       * cp-objcp-common.h (LANG_HOOKS_MARK_ADDRESSABLE): Remove.
+
 2009-08-31  Dodji Seketeli  <dodji@redhat.com>
 
        PR debug/30161
 2009-08-31  Dodji Seketeli  <dodji@redhat.com>
 
        PR debug/30161
index 6723a85..fe8a047 100644 (file)
@@ -58,8 +58,6 @@ extern bool cp_function_decl_explicit_p (tree decl);
 #define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL cxx_dup_lang_specific_decl
 #undef LANG_HOOKS_SET_DECL_ASSEMBLER_NAME
 #define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME mangle_decl
 #define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL cxx_dup_lang_specific_decl
 #undef LANG_HOOKS_SET_DECL_ASSEMBLER_NAME
 #define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME mangle_decl
-#undef LANG_HOOKS_MARK_ADDRESSABLE
-#define LANG_HOOKS_MARK_ADDRESSABLE cxx_mark_addressable
 #undef LANG_HOOKS_PRINT_STATISTICS
 #define LANG_HOOKS_PRINT_STATISTICS cxx_print_statistics
 #undef LANG_HOOKS_PRINT_XNODE
 #undef LANG_HOOKS_PRINT_STATISTICS
 #define LANG_HOOKS_PRINT_STATISTICS cxx_print_statistics
 #undef LANG_HOOKS_PRINT_XNODE
index f690ab1..ac4175a 100644 (file)
@@ -1,3 +1,8 @@
+2009-09-01  Richard Guenther  <rguenther@suse.de>
+
+       * f95-lang.c (gfc_mark_addressable): Remove.
+       (LANG_HOOKS_MARK_ADDRESSABLE): Likewise.
+
 2009-08-31  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR fortran/39229
 2009-08-31  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR fortran/39229
index f9d1878..181f0fc 100644 (file)
@@ -94,7 +94,6 @@ static void gfc_init_builtin_functions (void);
 static bool gfc_init (void);
 static void gfc_finish (void);
 static void gfc_print_identifier (FILE *, tree, int);
 static bool gfc_init (void);
 static void gfc_finish (void);
 static void gfc_print_identifier (FILE *, tree, int);
-static bool gfc_mark_addressable (tree);
 void do_function_end (void);
 int global_bindings_p (void);
 static void clear_binding_stack (void);
 void do_function_end (void);
 int global_bindings_p (void);
 static void clear_binding_stack (void);
@@ -137,7 +136,6 @@ static void gfc_init_ts (void);
 #define LANG_HOOKS_POST_OPTIONS                gfc_post_options
 #define LANG_HOOKS_PRINT_IDENTIFIER     gfc_print_identifier
 #define LANG_HOOKS_PARSE_FILE           gfc_be_parse_file
 #define LANG_HOOKS_POST_OPTIONS                gfc_post_options
 #define LANG_HOOKS_PRINT_IDENTIFIER     gfc_print_identifier
 #define LANG_HOOKS_PARSE_FILE           gfc_be_parse_file
-#define LANG_HOOKS_MARK_ADDRESSABLE    gfc_mark_addressable
 #define LANG_HOOKS_TYPE_FOR_MODE       gfc_type_for_mode
 #define LANG_HOOKS_TYPE_FOR_SIZE       gfc_type_for_size
 #define LANG_HOOKS_GET_ALIAS_SET       gfc_get_alias_set
 #define LANG_HOOKS_TYPE_FOR_MODE       gfc_type_for_mode
 #define LANG_HOOKS_TYPE_FOR_SIZE       gfc_type_for_size
 #define LANG_HOOKS_GET_ALIAS_SET       gfc_get_alias_set
@@ -563,84 +561,6 @@ gfc_init_decl_processing (void)
 }
 
 
 }
 
 
-/* Mark EXP saying that we need to be able to take the
-   address of it; it should not be allocated in a register.
-   In Fortran 95 this is only the case for variables with
-   the TARGET attribute, but we implement it here for a
-   likely future Cray pointer extension.
-   Value is 1 if successful.  */
-/* TODO: Check/fix mark_addressable.  */
-
-bool
-gfc_mark_addressable (tree exp)
-{
-  register tree x = exp;
-  while (1)
-    switch (TREE_CODE (x))
-      {
-      case COMPONENT_REF:
-      case ADDR_EXPR:
-      case ARRAY_REF:
-      case REALPART_EXPR:
-      case IMAGPART_EXPR:
-       x = TREE_OPERAND (x, 0);
-       break;
-
-      case CONSTRUCTOR:
-       TREE_ADDRESSABLE (x) = 1;
-       return true;
-
-      case VAR_DECL:
-      case CONST_DECL:
-      case PARM_DECL:
-      case RESULT_DECL:
-       if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x) && DECL_NONLOCAL (x))
-         {
-           if (TREE_PUBLIC (x))
-             {
-               error ("global register variable %qs used in nested function",
-                      IDENTIFIER_POINTER (DECL_NAME (x)));
-               return false;
-             }
-           pedwarn (input_location, 0, "register variable %qs used in nested function",
-                    IDENTIFIER_POINTER (DECL_NAME (x)));
-         }
-       else if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x))
-         {
-           if (TREE_PUBLIC (x))
-             {
-               error ("address of global register variable %qs requested",
-                      IDENTIFIER_POINTER (DECL_NAME (x)));
-               return true;
-             }
-
-#if 0
-           /* If we are making this addressable due to its having
-              volatile components, give a different error message.  Also
-              handle the case of an unnamed parameter by not trying
-              to give the name.  */
-
-           else if (C_TYPE_FIELDS_VOLATILE (TREE_TYPE (x)))
-             {
-               error ("cannot put object with volatile field into register");
-               return false;
-             }
-#endif
-
-           pedwarn (input_location, 0, "address of register variable %qs requested",
-                    IDENTIFIER_POINTER (DECL_NAME (x)));
-         }
-
-       /* drops in */
-      case FUNCTION_DECL:
-       TREE_ADDRESSABLE (x) = 1;
-
-      default:
-       return true;
-      }
-}
-
-
 /* Return the typed-based alias set for T, which may be an expression
    or a type.  Return -1 if we don't do anything special.  */
 
 /* Return the typed-based alias set for T, which may be an expression
    or a type.  Return -1 if we don't do anything special.  */
 
index 7c1ac22..a291dff 100644 (file)
@@ -1,3 +1,9 @@
+2009-09-01  Richard Guenther  <rguenther@suse.de>
+
+       * lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Remove.
+       * java-tree.h (java_mark_addressable): Likewise.
+       * typeck.c (java_mark_addressable): Likewise.
+
 2009-08-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * Make-lang.in (java.install-pdf): Install gcj.pdf in
 2009-08-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * Make-lang.in (java.install-pdf): Install gcj.pdf in
index 3bdd75a..29027eb 100644 (file)
@@ -988,7 +988,6 @@ struct GTY(()) lang_type {
 struct eh_range;
 
 extern void java_parse_file (int);
 struct eh_range;
 
 extern void java_parse_file (int);
-extern bool java_mark_addressable (tree);
 extern tree java_type_for_mode (enum machine_mode, int);
 extern tree java_type_for_size (unsigned int, int);
 extern tree java_truthvalue_conversion (tree);
 extern tree java_type_for_mode (enum machine_mode, int);
 extern tree java_type_for_size (unsigned int, int);
 extern tree java_truthvalue_conversion (tree);
index 4b46270..109ec51 100644 (file)
@@ -129,8 +129,6 @@ struct GTY(()) language_function {
 #define LANG_HOOKS_POST_OPTIONS java_post_options
 #undef LANG_HOOKS_PARSE_FILE
 #define LANG_HOOKS_PARSE_FILE java_parse_file
 #define LANG_HOOKS_POST_OPTIONS java_post_options
 #undef LANG_HOOKS_PARSE_FILE
 #define LANG_HOOKS_PARSE_FILE java_parse_file
-#undef LANG_HOOKS_MARK_ADDRESSABLE
-#define LANG_HOOKS_MARK_ADDRESSABLE java_mark_addressable
 #undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
 #define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL java_dup_lang_specific_decl
 #undef LANG_HOOKS_DECL_PRINTABLE_NAME
 #undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
 #define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL java_dup_lang_specific_decl
 #undef LANG_HOOKS_DECL_PRINTABLE_NAME
index c16976c..1024b7a 100644 (file)
@@ -193,71 +193,6 @@ java_type_for_size (unsigned bits, int unsignedp)
   return 0;
 }
 
   return 0;
 }
 
-/* Mark EXP saying that we need to be able to take the
-   address of it; it should not be allocated in a register.
-   Value is true if successful.  */
-
-bool
-java_mark_addressable (tree exp)
-{
-  tree x = exp;
-  while (1)
-    switch (TREE_CODE (x))
-      {
-      case ADDR_EXPR:
-      case COMPONENT_REF:
-      case ARRAY_REF:
-      case REALPART_EXPR:
-      case IMAGPART_EXPR:
-       x = TREE_OPERAND (x, 0);
-       break;
-
-      case TRUTH_ANDIF_EXPR:
-      case TRUTH_ORIF_EXPR:
-      case COMPOUND_EXPR:
-       x = TREE_OPERAND (x, 1);
-       break;
-
-      case COND_EXPR:
-       return java_mark_addressable (TREE_OPERAND (x, 1))
-         && java_mark_addressable (TREE_OPERAND (x, 2));
-
-      case CONSTRUCTOR:
-       TREE_ADDRESSABLE (x) = 1;
-       return true;
-
-      case INDIRECT_REF:
-       /* We sometimes add a cast *(TYPE*)&FOO to handle type and mode
-          incompatibility problems.  Handle this case by marking FOO.  */
-       if (TREE_CODE (TREE_OPERAND (x, 0)) == NOP_EXPR
-           && TREE_CODE (TREE_OPERAND (TREE_OPERAND (x, 0), 0)) == ADDR_EXPR)
-         {
-           x = TREE_OPERAND (TREE_OPERAND (x, 0), 0);
-           break;
-         }
-       if (TREE_CODE (TREE_OPERAND (x, 0)) == ADDR_EXPR)
-         {
-           x = TREE_OPERAND (x, 0);
-           break;
-         }
-       return true;
-
-      case VAR_DECL:
-      case CONST_DECL:
-      case PARM_DECL:
-      case RESULT_DECL:
-      case FUNCTION_DECL:
-       TREE_ADDRESSABLE (x) = 1;
-#if 0  /* poplevel deals with this now.  */
-       if (DECL_CONTEXT (x) == 0)
-         TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (x)) = 1;
-#endif
-       /* drops through */
-      default:
-       return true;
-    }
-}
-
 /* Thorough checking of the arrayness of TYPE.  */
 
 int
 /* Thorough checking of the arrayness of TYPE.  */
 
 int
index 25d96e9..afbab6f 100644 (file)
@@ -243,7 +243,6 @@ extern tree lhd_make_node (enum tree_code);
   LANG_HOOKS_MISSING_NORETURN_OK_P, \
   LANG_HOOKS_GET_ALIAS_SET, \
   LANG_HOOKS_FINISH_INCOMPLETE_DECL, \
   LANG_HOOKS_MISSING_NORETURN_OK_P, \
   LANG_HOOKS_GET_ALIAS_SET, \
   LANG_HOOKS_FINISH_INCOMPLETE_DECL, \
-  LANG_HOOKS_MARK_ADDRESSABLE, \
   LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, \
   LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, \
   LANG_HOOKS_PRINT_STATISTICS, \
   LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, \
   LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, \
   LANG_HOOKS_PRINT_STATISTICS, \
index d708bb2..4a590de 100644 (file)
@@ -298,11 +298,6 @@ struct lang_hooks
      compilation.  Default hook is does nothing.  */
   void (*finish_incomplete_decl) (tree);
 
      compilation.  Default hook is does nothing.  */
   void (*finish_incomplete_decl) (tree);
 
-  /* Mark EXP saying that we need to be able to take the address of
-     it; it should not be allocated in a register.  Return true if
-     successful.  */
-  bool (*mark_addressable) (tree);
-
   /* Replace the DECL_LANG_SPECIFIC data, which may be NULL, of the
      DECL_NODE with a newly GC-allocated copy.  */
   void (*dup_lang_specific_decl) (tree);
   /* Replace the DECL_LANG_SPECIFIC data, which may be NULL, of the
      DECL_NODE with a newly GC-allocated copy.  */
   void (*dup_lang_specific_decl) (tree);
index fe60ba6..0a36e10 100644 (file)
@@ -737,7 +737,7 @@ expand_asm_operands (tree string, tree outputs, tree inputs,
              || (DECL_P (val)
                  && REG_P (DECL_RTL (val))
                  && GET_MODE (DECL_RTL (val)) != TYPE_MODE (type))))
              || (DECL_P (val)
                  && REG_P (DECL_RTL (val))
                  && GET_MODE (DECL_RTL (val)) != TYPE_MODE (type))))
-       lang_hooks.mark_addressable (val);
+       mark_addressable (val);
 
       if (is_inout)
        ninout++;
 
       if (is_inout)
        ninout++;
@@ -766,7 +766,7 @@ expand_asm_operands (tree string, tree outputs, tree inputs,
        return;
 
       if (! allows_reg && allows_mem)
        return;
 
       if (! allows_reg && allows_mem)
-       lang_hooks.mark_addressable (TREE_VALUE (tail));
+       mark_addressable (TREE_VALUE (tail));
     }
 
   /* Second pass evaluates arguments.  */
     }
 
   /* Second pass evaluates arguments.  */
index 720180c..8de4675 100644 (file)
@@ -890,7 +890,6 @@ tree force_gimple_operand (tree, gimple_seq *, bool, tree);
 tree force_gimple_operand_gsi (gimple_stmt_iterator *, tree, bool, tree,
                               bool, enum gsi_iterator_update);
 tree gimple_fold_indirect_ref (tree);
 tree force_gimple_operand_gsi (gimple_stmt_iterator *, tree, bool, tree,
                               bool, enum gsi_iterator_update);
 tree gimple_fold_indirect_ref (tree);
-void mark_addressable (tree);
 
 /* In tree-ssa-live.c */
 extern void remove_unused_locals (void);
 
 /* In tree-ssa-live.c */
 extern void remove_unused_locals (void);
index 2791830..441612a 100644 (file)
@@ -5157,6 +5157,7 @@ extern bool in_gimple_form;
 
 /* In gimple.c.  */
 extern tree get_base_address (tree t);
 
 /* In gimple.c.  */
 extern tree get_base_address (tree t);
+extern void mark_addressable (tree);
 
 /* In tree-vectorizer.c.  */
 extern void vect_set_verbosity_level (const char *);
 
 /* In tree-vectorizer.c.  */
 extern void vect_set_verbosity_level (const char *);