diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-12-06 21:06:43 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-12-06 21:06:43 +0000 |
commit | 1e34298419a620070cd4098c0a48eec4b6066ea9 (patch) | |
tree | b30ae3524fb44587f4f26684405b0d23a71969fb /gcc | |
parent | 40cf892af51a4af43b3d7f3bf63457680fa92672 (diff) | |
download | gcc-1e34298419a620070cd4098c0a48eec4b6066ea9.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142527 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr38428.c | 20 | ||||
-rw-r--r-- | gcc/tree-ssa-operands.c | 4 |
4 files changed, 33 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 984e8ba4239..2f6ea171a92 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bf19792649c..2e6c2daf24c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 00000000000..aa32fc149f4 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr38428.c @@ -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; +} diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index 96241889538..85a0a08b3da 100644 --- a/gcc/tree-ssa-operands.c +++ b/gcc/tree-ssa-operands.c @@ -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: |