OSDN Git Service

PR tree-optimization/33856
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 5 Nov 2007 08:44:23 +0000 (08:44 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 5 Nov 2007 08:44:23 +0000 (08:44 +0000)
* tree-data-ref.c (get_references_in_stmt): Don't add
REFERENCE_CLASS_P trees to references vector if get_base_address
returns NULL on them.

* gcc.c-torture/compile/20071027-1.c: New test.

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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/20071027-1.c [new file with mode: 0644]
gcc/tree-data-ref.c

index 42c79ff..0b546de 100644 (file)
@@ -1,3 +1,10 @@
+2007-11-05  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/33856
+       * tree-data-ref.c (get_references_in_stmt): Don't add
+       REFERENCE_CLASS_P trees to references vector if get_base_address
+       returns NULL on them.
+
 2007-11-05  Alexandre Oliva  <aoliva@redhat.com>
 
        * cfg.c (dump_cfg_bb_info): Update bb_bitnames to match enum.
index 69d30f9..f8f4ed1 100644 (file)
@@ -1,5 +1,8 @@
 2007-11-05  Jakub Jelinek  <jakub@redhat.com>
 
+       PR tree-optimization/33856
+       * gcc.c-torture/compile/20071027-1.c: New test.
+
        PR c++/33836
        * g++.dg/ext/label10.C: New test.
 
diff --git a/gcc/testsuite/gcc.c-torture/compile/20071027-1.c b/gcc/testsuite/gcc.c-torture/compile/20071027-1.c
new file mode 100644 (file)
index 0000000..c550406
--- /dev/null
@@ -0,0 +1,25 @@
+/* PR tree-optimization/33856 */
+/* Testcase by Martin Michlmayr <tbm@cyrius.com> */
+
+typedef struct z_key
+{
+  int key;
+  int mask;
+} z_key;
+typedef struct picture_size
+{
+  z_key key;
+} picture_size;
+
+void picture_size_new (picture_size *ps)
+{
+  z_key key;
+  ps->key = key;
+}
+
+void picture_sizes_load_default (picture_size *ps)
+{
+  int i;
+  for (i = 0; i < 5; ++i)
+    picture_size_new (ps);
+}
index 17851ee..bf7d2ab 100644 (file)
@@ -3913,7 +3913,7 @@ get_references_in_stmt (tree stmt, VEC (data_ref_loc, heap) **references)
       op1 = &GIMPLE_STMT_OPERAND (stmt, 1);
                
       if (DECL_P (*op1)
-         || REFERENCE_CLASS_P (*op1))
+         || (REFERENCE_CLASS_P (*op1) && get_base_address (*op1)))
        {
          ref = VEC_safe_push (data_ref_loc, heap, *references, NULL);
          ref->pos = op1;
@@ -3921,7 +3921,7 @@ get_references_in_stmt (tree stmt, VEC (data_ref_loc, heap) **references)
        }
 
       if (DECL_P (*op0)
-         || REFERENCE_CLASS_P (*op0))
+         || (REFERENCE_CLASS_P (*op0) && get_base_address (*op0)))
        {
          ref = VEC_safe_push (data_ref_loc, heap, *references, NULL);
          ref->pos = op0;
@@ -3938,7 +3938,7 @@ get_references_in_stmt (tree stmt, VEC (data_ref_loc, heap) **references)
          op0 = &CALL_EXPR_ARG (call, i);
 
          if (DECL_P (*op0)
-             || REFERENCE_CLASS_P (*op0))
+             || (REFERENCE_CLASS_P (*op0) && get_base_address (*op0)))
            {
              ref = VEC_safe_push (data_ref_loc, heap, *references, NULL);
              ref->pos = op0;