re PR lto/47641 (gcc.dg/lto/20101009-1 c_lto_20101009-1_0.o-c_lto_20101009-1_0.o...
authorRichard Guenther <rguenther@suse.de>
Tue, 8 Feb 2011 12:53:50 +0000 (12:53 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 8 Feb 2011 12:53:50 +0000 (12:53 +0000)
2011-02-08  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/47641
* tree-ssa.c (execute_update_addresses_taken): For asm outputs
require type compatibility.

From-SVN: r169925

gcc/ChangeLog
gcc/tree-ssa.c

index 36e7a731040e928550ff54e720dd7c6320672cda..f22f6673c88206f7e9a95007fb6ee2d851384a02 100644 (file)
@@ -1,3 +1,9 @@
+2011-02-08  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/47641
+       * tree-ssa.c (execute_update_addresses_taken): For asm outputs
+       require type compatibility.
+
 2011-02-08  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
 
        * gimple-low.c (lower_function_body): Don't remove the location of
index 90fb5dd181132061829d039da8477b0415497b2e..cc8c83d7c00779506406afe49c2f8ebf4609fa89 100644 (file)
@@ -1898,7 +1898,7 @@ non_rewritable_lvalue_p (tree lhs)
   /* A decl that is wrapped inside a MEM-REF that covers
      it full is also rewritable.
      ???  The following could be relaxed allowing component
-     references that do not change the access size.  */ ;
+     references that do not change the access size.  */
   if (TREE_CODE (lhs) == MEM_REF
       && TREE_CODE (TREE_OPERAND (lhs, 0)) == ADDR_EXPR
       && integer_zerop (TREE_OPERAND (lhs, 1)))
@@ -2039,11 +2039,16 @@ execute_update_addresses_taken (void)
                {
                  tree link = gimple_asm_output_op (stmt, i);
                  tree lhs = TREE_VALUE (link);
-                 if (TREE_CODE (lhs) != SSA_NAME
-                     && non_rewritable_lvalue_p (lhs))
+                 if (TREE_CODE (lhs) != SSA_NAME)
                    {
                      decl = get_base_address (lhs);
-                     if (DECL_P (decl))
+                     if (DECL_P (decl)
+                         && (non_rewritable_lvalue_p (lhs)
+                             /* We cannot move required conversions from
+                                the lhs to the rhs in asm statements, so
+                                require we do not need any.  */
+                             || !useless_type_conversion_p
+                                   (TREE_TYPE (lhs), TREE_TYPE (decl))))
                        bitmap_set_bit (not_reg_needs, DECL_UID (decl));
                    }
                }