OSDN Git Service

PR middle-end/42029
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 13 Nov 2009 18:38:36 +0000 (18:38 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 13 Nov 2009 18:38:36 +0000 (18:38 +0000)
* gimplify.c (gimplify_omp_atomic): Set DECL_GIMPLE_REG_P on
tmp_load if needed.

* libgomp.c/pr42029.c: New test.

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

gcc/ChangeLog
gcc/gimplify.c
libgomp/ChangeLog
libgomp/testsuite/libgomp.c/pr42029.c [new file with mode: 0644]

index bb92e10..e5dec6f 100644 (file)
@@ -1,8 +1,14 @@
+2009-11-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/42029
+       * gimplify.c (gimplify_omp_atomic): Set DECL_GIMPLE_REG_P on
+       tmp_load if needed.
+
 2009-11-13  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/41900
-       (*call_pop_1, *call_1, *call_value_pop_1, *call_value_1): Use "lsm"
-       as operand 1 constraint.
+       * config/i386/i386.md (*call_pop_1, *call_1, *call_value_pop_1,
+       *call_value_1): Use "lsm" as operand 1 constraint.
        * config/i386/predicates.md (call_insn_operand): Depend on
        index_register_operand to avoid %esp register.
 
index d68aacd..8404e0f 100644 (file)
@@ -6231,6 +6231,8 @@ gimplify_omp_atomic (tree *expr_p, gimple_seq *pre_p)
   tree tmp_load;
 
    tmp_load = create_tmp_var (type, NULL);
+   if (TREE_CODE (type) == COMPLEX_TYPE || TREE_CODE (type) == VECTOR_TYPE)
+     DECL_GIMPLE_REG_P (tmp_load) = 1;
    if (goa_stabilize_expr (&rhs, pre_p, addr, tmp_load) < 0)
      return GS_ERROR;
 
index ba9393e..e36c7e2 100644 (file)
@@ -1,3 +1,8 @@
+2009-11-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/42029
+       * libgomp.c/pr42029.c: New test.
+
 2009-10-26  Jakub Jelinek  <jakub@redhat.com>
 
        * acinclude.m4 (LIBGOMP_CHECK_LINKER_FEATURES): Avoid using too many
diff --git a/libgomp/testsuite/libgomp.c/pr42029.c b/libgomp/testsuite/libgomp.c/pr42029.c
new file mode 100644 (file)
index 0000000..ea7ac2c
--- /dev/null
@@ -0,0 +1,19 @@
+/* PR middle-end/42029 */
+/* { dg-do run } */
+
+extern void abort (void);
+
+int
+main ()
+{
+  int i;
+  _Complex int c = 0;
+
+#pragma omp parallel for private(i) reduction(+:c)
+  for (i = 0; i < 8; ++i)
+    c += 1;
+
+  if (c != 8)
+    abort ();
+  return 0;
+}