[revert the minor PR45144 missed-optimization fix because it results in miscompilation of gnat on m68k with gcc-4.6 and 4.5, with gcc-4.7 other changes mask the issue; updated 2013-01-26 due to PR55755 changes to pr45144.c ] gcc/ 2013-01-26 Mikael Pettersson PR ada/48835 Revert 2010-08-05 Jie Zhang PR tree-optimization/45144 * tree-sra.c (type_consists_of_records_p): Return false if the record contains bit-field. gcc/testsuite/ 2013-01-26 Mikael Pettersson PR ada/48835 Revert 2010-09-10 Martin Jambor PR tree-optimization/44972 * gcc.dg/tree-ssa/pr45144.c: Adjust scanning expressions. Revert 2010-08-05 Jie Zhang PR tree-optimization/45144 * gcc.dg/tree-ssa/pr45144.c: New test. --- gcc-4.6-20130125/gcc/testsuite/gcc.dg/tree-ssa/pr45144.c.~1~ 2013-01-24 16:41:04.000000000 +0100 +++ gcc-4.6-20130125/gcc/testsuite/gcc.dg/tree-ssa/pr45144.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,46 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-optimized" } */ - -void baz (unsigned); - -extern unsigned buf[]; - -struct A -{ - unsigned a1:10; - unsigned a2:3; - unsigned:19; -}; - -union TMP -{ - struct A a; - unsigned int b; -}; - -static unsigned -foo (struct A *p) -{ - union TMP t; - struct A x; - - x = *p; - t.a = x; - return t.b; -} - -void -bar (unsigned orig, unsigned *new) -{ - struct A a; - union TMP s; - - s.b = orig; - a = s.a; - if (a.a1) - baz (a.a2); - *new = foo (&a); -} - -/* { dg-final { scan-tree-dump-not "unnamed-unsigned:19" "optimized"} } */ -/* { dg-final { cleanup-tree-dump "optimized" } } */ --- gcc-4.6-20130125/gcc/tree-sra.c.~1~ 2013-01-24 16:41:04.000000000 +0100 +++ gcc-4.6-20130125/gcc/tree-sra.c 2013-01-26 12:09:36.172458944 +0100 @@ -855,9 +855,6 @@ type_consists_of_records_p (tree type) { tree ft = TREE_TYPE (fld); - if (DECL_BIT_FIELD (fld)) - return false; - if (!is_gimple_reg_type (ft) && !type_consists_of_records_p (ft)) return false;