summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/gimplify.c15
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/pr39354.f9037
4 files changed, 61 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e71e642fd0e..38698827a12 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2009-03-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/39354
+ * gimplify.c (goa_stabilize_expr): Handle tcc_comparison,
+ TRUTH_ANDIF_EXPR and TRUTH_ORIF_EXPR.
+
2009-03-03 Richard Guenther <rguenther@suse.de>
PR middle-end/39272
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index ae12424589b..02d4923aa1e 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -6047,12 +6047,27 @@ goa_stabilize_expr (tree *expr_p, gimple_seq *pre_p, tree lhs_addr,
switch (TREE_CODE_CLASS (TREE_CODE (expr)))
{
case tcc_binary:
+ case tcc_comparison:
saw_lhs |= goa_stabilize_expr (&TREE_OPERAND (expr, 1), pre_p, lhs_addr,
lhs_var);
case tcc_unary:
saw_lhs |= goa_stabilize_expr (&TREE_OPERAND (expr, 0), pre_p, lhs_addr,
lhs_var);
break;
+ case tcc_expression:
+ switch (TREE_CODE (expr))
+ {
+ case TRUTH_ANDIF_EXPR:
+ case TRUTH_ORIF_EXPR:
+ saw_lhs |= goa_stabilize_expr (&TREE_OPERAND (expr, 1), pre_p,
+ lhs_addr, lhs_var);
+ saw_lhs |= goa_stabilize_expr (&TREE_OPERAND (expr, 0), pre_p,
+ lhs_addr, lhs_var);
+ break;
+ default:
+ break;
+ }
+ break;
default:
break;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3bb4d97c658..a4bfe792d4f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2009-03-03 Jakub Jelinek <jakub@redhat.com>
+ PR fortran/39354
+ * gfortran.dg/gomp/pr39354.f90: New test.
+
PR tree-optimization/39343
* gcc.dg/pr39343.c: New test.
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr39354.f90 b/gcc/testsuite/gfortran.dg/gomp/pr39354.f90
new file mode 100644
index 00000000000..3b9c327849a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/pr39354.f90
@@ -0,0 +1,37 @@
+! PR fortran/39354
+! { dg-do compile }
+! { dg-options "-fopenmp" }
+ SUBROUTINE ltest(l1, l2, l3, l4, r1, r2, r3, r4)
+ LOGICAL l1, l2, l3, l4, r1, r2, r3, r4
+!$OMP ATOMIC
+ l1 = l1 .and. r1
+!$OMP ATOMIC
+ l2 = l2 .or. r2
+!$OMP ATOMIC
+ l3 = l3 .eqv. r3
+!$OMP ATOMIC
+ l4 = l4 .neqv. r4
+ END
+ SUBROUTINE itest(l1, l2, l3, l4, l5, l6, l7, l8, l9, &
+& r1, r2, r3, r4, r5, r6, r7, r8, r9)
+ INTEGER l1, l2, l3, l4, l5, l6, l7, l8, l9, &
+& r1, r2, r3, r4, r5, r6, r7, r8, r9
+!$OMP ATOMIC
+ l1 = l1 + r1
+!$OMP ATOMIC
+ l2 = l2 - r2
+!$OMP ATOMIC
+ l3 = l3 * r3
+!$OMP ATOMIC
+ l4 = l4 / r4
+!$OMP ATOMIC
+ l5 = max (l5, r1, r5)
+!$OMP ATOMIC
+ l6 = min (r1, r6, l6)
+!$OMP ATOMIC
+ l7 = iand (l7, r7)
+!$OMP ATOMIC
+ l8 = ior (r8, l8)
+!$OMP ATOMIC
+ l9 = ieor (l9, r9)
+ END