re PR tree-optimization/55355 (internal compiler error: in tree_low_cst, at tree.c:6415)

2012-12-21  Martin Jambor  <mjambor@suse.cz>

	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: r194682
This commit is contained in:
Martin Jambor 2012-12-21 23:06:38 +01:00 committed by Martin Jambor
parent c84a808e49
commit 28afe3fc7b
4 changed files with 40 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2012-12-21 Martin Jambor <mjambor@suse.cz>
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-21 Eric Botcazou <ebotcazou@adacore.com>
* rtlanal.c (volatile_insn_p): Delete commented out code.

View File

@ -1,3 +1,8 @@
2012-12-21 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/55355
* g++.dg/torture/pr55355.C: New test.
2012-12-21 Vladimir Makarov <vmakarov@redhat.com>
PR middle-end/55775

View File

@ -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();
}

View File

@ -714,7 +714,12 @@ type_internals_preclude_sra_p (tree type, const char **msg)
{
*msg = "structure field size not fixed";
return true;
}
}
if (!host_integerp (bit_position (fld), 0))
{
*msg = "structure field size too big";
return true;
}
if (AGGREGATE_TYPE_P (ft)
&& int_bit_position (fld) % BITS_PER_UNIT != 0)
{