From: Martin Jambor Date: Fri, 21 Dec 2012 22:28:40 +0000 (+0100) Subject: re PR tree-optimization/55355 (internal compiler error: in tree_low_cst, at tree... X-Git-Tag: releases/gcc-4.6.4~228 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35a74ec14e698d26e377e0b7f844b6b8f5e1701a;p=thirdparty%2Fgcc.git re PR tree-optimization/55355 (internal compiler error: in tree_low_cst, at tree.c:6415) 2012-12-21 Martin Jambor PR tree-optimization/55355 * tree-sra.c (type_internals_preclude_sra_p): Also check that bit_position is small enough to fit a single HOST_WIDE_INT. * testsuite/g++.dg/torture/pr55355.C: New test. From-SVN: r194686 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dd882bf1d229..a9b503665bfa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-12-21 Martin Jambor + + PR tree-optimization/55355 + * tree-sra.c (type_internals_preclude_sra_p): Also check that + bit_position is small enough to fit a single HOST_WIDE_INT. + 2012-12-11 Eric Botcazou PR target/54121 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ba4f111370fc..849d43206092 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-12-21 Martin Jambor + + PR tree-optimization/55355 + * g++.dg/torture/pr55355.C: New test. + 2012-12-01 John David Anglin * gcc.dg/torture/pr52407.c: Add "-fno-common" option on hppa*-*-hpux*. diff --git a/gcc/testsuite/g++.dg/torture/pr55355.C b/gcc/testsuite/g++.dg/torture/pr55355.C new file mode 100644 index 000000000000..6d8f8b6be1ec --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr55355.C @@ -0,0 +1,23 @@ +/* { dg-do compile } */ + +struct A +{ + void funcA(void); +}; + +struct B {}; + +struct C +{ + void funcC(void) { a_mp->funcA(); } + + char buf_ma[268435456]; + A *a_mp; + B b_m; +}; + +void +func(C *c_p) +{ + c_p->funcC(); +} diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index 7f91a936506f..17a27d04e3f3 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -666,6 +666,7 @@ type_internals_preclude_sra_p (tree type) || !DECL_FIELD_OFFSET (fld) || !DECL_SIZE (fld) || !host_integerp (DECL_FIELD_OFFSET (fld), 1) || !host_integerp (DECL_SIZE (fld), 1) + || !host_integerp (bit_position (fld), 0) || (AGGREGATE_TYPE_P (ft) && int_bit_position (fld) % BITS_PER_UNIT != 0)) return true;