re PR tree-optimization/33870 (miscompiles sqlite)
authorRichard Guenther <rguenther@suse.de>
Mon, 29 Oct 2007 21:47:05 +0000 (21:47 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 29 Oct 2007 21:47:05 +0000 (21:47 +0000)
2007-10-29  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/33870
* tree-ssa-operands.c (add_vars_for_offset): Remove mpt_vars parameter.
(add_virtual_operand): Do not recurse into MPTs looking for pointed-to
SFTs.

* gcc.c-torture/execute/pr33870.x: XFAIL testcase for -O2 and -Os.

From-SVN: r129738

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr33870.x [new file with mode: 0644]
gcc/tree-ssa-operands.c

index f8dd7fcb22fe990ccda4acd3ea58a0c8910e1e0d..9899775fb38348d0dc6b5025ff5ece2f36f72b12 100644 (file)
@@ -1,3 +1,10 @@
+2007-10-29  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/33870
+       * tree-ssa-operands.c (add_vars_for_offset): Remove mpt_vars parameter.
+       (add_virtual_operand): Do not recurse into MPTs looking for pointed-to
+       SFTs.
+
 2007-10-29  Richard Guenther  <rguenther@suse.de>
 
        * passes.c (init_optimization_passes): Exchange store_copy_prop
index ab84896eae2afc3202dc88c5b512cf9ccdeb92c5..bde12e5fd6564812c978efa0a7cfd4e7d0287c21 100644 (file)
@@ -1,3 +1,8 @@
+2007-10-29  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/33870
+       * gcc.c-torture/execute/pr33870.x: XFAIL testcase for -O2 and -Os.
+
 2007-10-29  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/33757
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr33870.x b/gcc/testsuite/gcc.c-torture/execute/pr33870.x
new file mode 100644 (file)
index 0000000..fbf8aae
--- /dev/null
@@ -0,0 +1,9 @@
+# The test breaks because of wrong alias info for -O2 and -Os
+
+set torture_eval_before_compile {
+  if {[string match {*-O[2s]*} "$option"]} {
+     set torture_execute_xfail "*-*-*"
+  }
+}
+
+return 0
index 1203a47faab1c551a19a3d52b7f4ec022b64f961..8772313f3acc8a59948992cefadfbea419f1d863 100644 (file)
@@ -1391,7 +1391,7 @@ access_can_touch_variable (tree ref, tree alias, HOST_WIDE_INT offset,
 static bool
 add_vars_for_offset (tree var,
                     unsigned HOST_WIDE_INT offset, unsigned HOST_WIDE_INT size,
-                    bool is_def, bitmap mpt_vars)
+                    bool is_def)
 {
   bool added = false;
   tree subvar;
@@ -1412,16 +1412,10 @@ add_vars_for_offset (tree var,
       if (size <= SFT_OFFSET (subvar) - offset)
        break;
 
-      /* Avoid adding a SFT that is contained in the same MPT as the
-        pointed-to location as this MPT will be added as alias anyway.  */
-      if (!mpt_vars
-         || !bitmap_bit_p (mpt_vars, DECL_UID (subvar)))
-       {
-         if (is_def)
-           append_vdef (subvar);
-         else
-           append_vuse (subvar);
-       }
+      if (is_def)
+       append_vdef (subvar);
+      else
+       append_vuse (subvar);
       added = true;
     }
 
@@ -1502,34 +1496,12 @@ add_virtual_operand (tree var, stmt_ann_t s_ann, int flags,
        {
          tree al = referenced_var (i);
 
-         /* We have to consider SFTs inside MPTs as possible pointed-to
-            location as well because even if aliases does not contain
-            a single SFT, the SFTs inside the MPT may be incomplete in
-            that not all aliased subvars have to be in this MPT, too.
-            But only if we start with NMT aliases.  */
-         if (TREE_CODE (al) == MEMORY_PARTITION_TAG
-             && TREE_CODE (var) == NAME_MEMORY_TAG)
-           {
-             bitmap_iterator bi;
-             unsigned int i;
-
-             EXECUTE_IF_SET_IN_BITMAP (MPT_SYMBOLS (al), 0, i, bi)
-               {
-                 tree ptsft = referenced_var (i);
-
-                 if (TREE_CODE (ptsft) == STRUCT_FIELD_TAG)
-                   none_added &= !add_vars_for_offset (ptsft, offset, size,
-                                                       flags & opf_def,
-                                                       MPT_SYMBOLS (al));
-               }
-           }
-
          /* For SFTs we have to consider all subvariables of the parent var
             if it is a potential points-to location.  */
          if (TREE_CODE (al) == STRUCT_FIELD_TAG
              && TREE_CODE (var) == NAME_MEMORY_TAG)
            none_added &= !add_vars_for_offset (al, offset, size,
-                                               flags & opf_def, NULL);
+                                               flags & opf_def);
          else
            {
              /* Call-clobbered tags may have non-call-clobbered