I am testing the following followup to my BIT_FIELD_REF simplification changes which resolve issues when applying to memory BIT_FIELD_REFs.
Bootstrap and regtest running on x86_64-unknown-linux-gnu. Richard. 2016-05-09 Richard Biener <rguent...@suse.de> PR tree-optimization/70985 * match.pd (BIT_FIELD_REF -> (type)): Disable on GIMPLE when op0 isn't a gimple register. * gcc.dg/torture/pr70985.c: New testcase. Index: gcc/match.pd =================================================================== *** gcc/match.pd (revision 236021) --- gcc/match.pd (working copy) *************** DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) *** 3244,3249 **** --- 3244,3251 ---- (view_convert (imagpart @0))))) (if (INTEGRAL_TYPE_P (TREE_TYPE (@0)) && INTEGRAL_TYPE_P (type) + /* On GIMPLE this should only apply to register arguments. */ + && (! GIMPLE || is_gimple_reg (@0)) /* A bit-field-ref that referenced the full argument can be stripped. */ && ((compare_tree_int (@1, TYPE_PRECISION (TREE_TYPE (@0))) == 0 && integer_zerop (@2)) Index: gcc/testsuite/gcc.dg/torture/pr70985.c =================================================================== *** gcc/testsuite/gcc.dg/torture/pr70985.c (revision 0) --- gcc/testsuite/gcc.dg/torture/pr70985.c (working copy) *************** *** 0 **** --- 1,28 ---- + /* { dg-do compile } */ + /* { dg-require-effective-target int32plus } */ + + struct + { + int f0:24; + } a, c, d; + + int b; + + int + fn1 () + { + return 0; + } + + void + fn2 () + { + int e; + if (b) + for (; e;) + { + d = c; + if (fn1 (b)) + b = a.f0; + } + }