OSDN Git Service

2010-04-23 Martin Jambor <mjambor@suse.cz>
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 23 Apr 2010 14:43:10 +0000 (14:43 +0000)
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 23 Apr 2010 14:43:10 +0000 (14:43 +0000)
PR middle-end/43835
* tree-sra.c (ipa_sra_preliminary_function_checks): Check that the
function does not have type attributes.

* testsuite/gcc.c-torture/execute/pr43835.c: New test.

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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr43835.c [new file with mode: 0644]
gcc/tree-sra.c

index d81d2eb..1d45422 100644 (file)
@@ -1,3 +1,9 @@
+2010-04-23  Martin Jambor  <mjambor@suse.cz>
+
+       PR middle-end/43835
+       * tree-sra.c (ipa_sra_preliminary_function_checks): Check that the
+       function does not have type attributes.
+
 2010-04-23  Richard Guenther  <rguenther@suse.de>
 
        PR lto/42653
index 5dfed40..5558134 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-23  Martin Jambor  <mjambor@suse.cz>
+
+       PR middle-end/43835
+       * gcc.c-torture/execute/pr43835.c: New test.
+
 2010-04-23  Richard Guenther  <rguenther@suse.de>
 
        PR lto/42653
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr43835.c b/gcc/testsuite/gcc.c-torture/execute/pr43835.c
new file mode 100644 (file)
index 0000000..97237f6
--- /dev/null
@@ -0,0 +1,51 @@
+struct PMC {
+    unsigned flags;
+};
+
+typedef struct Pcc_cell
+{
+    struct PMC *p;
+    long bla;
+    long type;
+} Pcc_cell;
+
+extern void abort ();
+extern void Parrot_gc_mark_PMC_alive_fun(int * interp, struct PMC *pmc)
+     __attribute__((noinline));
+
+void Parrot_gc_mark_PMC_alive_fun (int * interp, struct PMC *pmc)
+{
+  abort ();
+}
+
+static void mark_cell(int * interp, Pcc_cell *c)
+        __attribute__((__nonnull__(1)))
+        __attribute__((__nonnull__(2)))
+        __attribute__((noinline));
+
+static void
+mark_cell(int * interp, Pcc_cell *c)
+{
+            if (c->type == 4 && c->p
+               && !(c->p->flags & (1<<18)))
+             Parrot_gc_mark_PMC_alive_fun(interp, c->p);
+}
+
+void foo(int * interp, Pcc_cell *c);
+
+void
+foo(int * interp, Pcc_cell *c)
+{
+  mark_cell(interp, c);
+}
+
+int main()
+{
+  int i;
+  Pcc_cell c;
+  c.p = 0;
+  c.bla = 42;
+  c.type = 4;
+  foo (&i, &c);
+  return 0;
+}
index 0635aa7..b318201 100644 (file)
@@ -4162,6 +4162,9 @@ ipa_sra_preliminary_function_checks (struct cgraph_node *node)
       return false;
     }
 
+  if (TYPE_ATTRIBUTES (TREE_TYPE (node->decl)))
+    return false;
+
   return true;
 }