OSDN Git Service

gcc/
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa.c
index d4c519f..687c639 100644 (file)
@@ -1426,7 +1426,8 @@ useless_type_conversion_p (tree outer_type, tree inner_type)
      compared types.  */
   else if (AGGREGATE_TYPE_P (inner_type)
           && TREE_CODE (inner_type) == TREE_CODE (outer_type))
-    return gimple_types_compatible_p (outer_type, inner_type, false);
+    return (in_lto_p
+           && gimple_types_compatible_p (outer_type, inner_type, GTC_DIAG));
 
   return false;
 }
@@ -1631,6 +1632,8 @@ warn_uninit (tree t, const char *gmsgid, void *data)
     {
       TREE_NO_WARNING (var) = 1;
 
+      if (location == DECL_SOURCE_LOCATION (var))
+       return;
       if (xloc.file != floc.file
          || xloc.line < floc.line
          || xloc.line > LOCATION_LINE (cfun->function_end_locus))
@@ -1881,6 +1884,11 @@ maybe_optimize_var (tree var, bitmap addresses_taken, bitmap not_reg_needs)
       || bitmap_bit_p (addresses_taken, DECL_UID (var)))
     return false;
 
+  /* If the variable is not in the list of referenced vars then we
+     do not need to touch it nor can we rename it.  */
+  if (!referenced_var_lookup (DECL_UID (var)))
+    return false;
+
   if (TREE_ADDRESSABLE (var)
       /* Do not change TREE_ADDRESSABLE if we need to preserve var as
         a non-register.  Otherwise we are confused and forget to
@@ -2031,13 +2039,7 @@ execute_update_addresses_taken (bool do_optimize)
         unused vars from BLOCK trees which cause code generation
         differences for -g vs. -g0.  */
       for (var = DECL_ARGUMENTS (cfun->decl); var; var = DECL_CHAIN (var))
-       {
-         /* ???  Not all arguments are in referenced vars.  */
-         if (!var_ann (var))
-           continue;
-         update_vops
-           |= maybe_optimize_var (var, addresses_taken, not_reg_needs);
-       }
+       update_vops |= maybe_optimize_var (var, addresses_taken, not_reg_needs);
       for (i = 0; VEC_iterate (tree, cfun->local_decls, i, var); ++i)
        update_vops |= maybe_optimize_var (var, addresses_taken, not_reg_needs);
     }