]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/38428 (ice for Linux kernel code with -O2)
authorJakub Jelinek <jakub@redhat.com>
Sat, 6 Dec 2008 21:06:43 +0000 (22:06 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sat, 6 Dec 2008 21:06:43 +0000 (22:06 +0100)
PR middle-end/38428
* tree-ssa-operands.c (get_expr_operands) <case BIT_FIELD_REF>: Set
gimple_set_has_volatile_ops if the BIT_FIELD_REF is volatile.

* gcc.c-torture/compile/pr38428.c: New test.

From-SVN: r142527

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr38428.c [new file with mode: 0644]
gcc/tree-ssa-operands.c

index 984e8ba4239a427bed514d6b6daa78c9b02af5f4..2f6ea171a92042fd7e45ff0639ba666affc9fda0 100644 (file)
@@ -1,3 +1,9 @@
+2008-12-06  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/38428
+       * tree-ssa-operands.c (get_expr_operands) <case BIT_FIELD_REF>: Set
+       gimple_set_has_volatile_ops if the BIT_FIELD_REF is volatile.
+
 2008-12-07  Ben Elliston  <bje@au.ibm.com>
 
        * gthr-single.h (__gthread_once): Adjust prototype to match all
index bf19792649c04a987d636d3c7fe05b29d245c665..2e6c2daf24c6234d99361bf5c50ccc2d1f930251 100644 (file)
@@ -1,5 +1,8 @@
 2008-12-06  Jakub Jelinek  <jakub@redhat.com>
 
+       PR middle-end/38428
+       * gcc.c-torture/compile/pr38428.c: New test.
+
        PR middle-end/38422
        * gcc.c-torture/execute/pr38422.c: New test.
 
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr38428.c b/gcc/testsuite/gcc.c-torture/compile/pr38428.c
new file mode 100644 (file)
index 0000000..aa32fc1
--- /dev/null
@@ -0,0 +1,20 @@
+/* PR middle-end/38428 */
+
+struct S
+{
+  volatile struct
+  {
+    unsigned int t : 1;
+  } s;
+};
+
+int
+foo (struct S *x)
+{
+  int ret;
+  if (x->s.t)
+    ret = 0;
+  else
+    ret = 10;
+  return ret;
+}
index 962418895385dcdd525244b7e796b7e33a6fb9ab..85a0a08b3da67a8cefcd0b82fd286b5da9d202e1 100644 (file)
@@ -2010,6 +2010,10 @@ get_expr_operands (gimple stmt, tree *expr_p, int flags)
       }
 
     case BIT_FIELD_REF:
+      if (TREE_THIS_VOLATILE (expr))
+       gimple_set_has_volatile_ops (stmt, true);
+      /* FALLTHRU */
+
     case TRUTH_NOT_EXPR:
     case VIEW_CONVERT_EXPR:
     do_unary: