From: Jakub Jelinek Date: Sat, 6 Dec 2008 21:06:43 +0000 (+0100) Subject: re PR middle-end/38428 (ice for Linux kernel code with -O2) X-Git-Tag: releases/gcc-4.4.0~1324 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f11bea25dd16c9408329efdc83379b44fc644441;p=thirdparty%2Fgcc.git re PR middle-end/38428 (ice for Linux kernel code with -O2) PR middle-end/38428 * tree-ssa-operands.c (get_expr_operands) : Set gimple_set_has_volatile_ops if the BIT_FIELD_REF is volatile. * gcc.c-torture/compile/pr38428.c: New test. From-SVN: r142527 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 984e8ba4239a..2f6ea171a920 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-12-06 Jakub Jelinek + + PR middle-end/38428 + * tree-ssa-operands.c (get_expr_operands) : Set + gimple_set_has_volatile_ops if the BIT_FIELD_REF is volatile. + 2008-12-07 Ben Elliston * gthr-single.h (__gthread_once): Adjust prototype to match all diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bf19792649c0..2e6c2daf24c6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2008-12-06 Jakub Jelinek + 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 000000000000..aa32fc149f4c --- /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 962418895385..85a0a08b3da6 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: