OSDN Git Service

2009-09-01 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / java / typeck.c
index 1028c73..1024b7a 100644 (file)
@@ -131,8 +131,7 @@ convert (tree type, tree expr)
       if (type == char_type_node || type == promoted_char_type_node)
        return fold_convert (type, expr);
       if ((really_constant_p (expr) || ! flag_unsafe_math_optimizations)
-         && TREE_CODE (TREE_TYPE (expr)) == REAL_TYPE
-         && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT)
+         && TREE_CODE (TREE_TYPE (expr)) == REAL_TYPE)
        return convert_ieee_real_to_integer (type, expr);
       else
        {
@@ -194,71 +193,6 @@ java_type_for_size (unsigned bits, int unsignedp)
   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
@@ -348,7 +282,7 @@ build_java_array_type (tree element_type, HOST_WIDE_INT length)
       strcpy (suffix, "[]");
     TYPE_NAME (t) 
       = TYPE_STUB_DECL (t)
-      = build_decl (TYPE_DECL,
+      = build_decl (input_location, TYPE_DECL,
                    identifier_subst (el_name, "", '.', '.', suffix),
                              t);
     TYPE_DECL_SUPPRESS_DEBUG (TYPE_STUB_DECL (t)) = true;
@@ -361,7 +295,8 @@ build_java_array_type (tree element_type, HOST_WIDE_INT length)
   TYPE_ARRAY_ELEMENT (t) = element_type;
 
   /* Add length pseudo-field. */
-  fld = build_decl (FIELD_DECL, get_identifier ("length"), int_type_node);
+  fld = build_decl (input_location,
+                   FIELD_DECL, get_identifier ("length"), int_type_node);
   TYPE_FIELDS (t) = fld;
   DECL_CONTEXT (fld) = t;
   FIELD_PUBLIC (fld) = 1;
@@ -369,7 +304,8 @@ build_java_array_type (tree element_type, HOST_WIDE_INT length)
   TREE_READONLY (fld) = 1;
 
   atype = build_prim_array_type (element_type, length);
-  arfld = build_decl (FIELD_DECL, get_identifier ("data"), atype);
+  arfld = build_decl (input_location,
+                     FIELD_DECL, get_identifier ("data"), atype);
   DECL_CONTEXT (arfld) = t;
   TREE_CHAIN (fld) = arfld;
   DECL_ALIGN (arfld) = TYPE_ALIGN (element_type);