Commit 8056eb4f by Martin Jambor Committed by Martin Jambor

re PR tree-optimization/40351 (ice in generate_subtree_copies for Linux kernel build)

2009-06-09  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/40351
	* tree-sra.c (propagate_subacesses_accross_link): Check that a refrence
	to a potential artifical subaccess can be constructed.

	* testsuite/gcc.c-torture/compile/pr40351.c: New file.

From-SVN: r148315
parent ff346f70
2009-06-09 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/40351
* tree-sra.c (propagate_subacesses_accross_link): Check that a refrence
to a potential artifical subaccess can be constructed.
2009-06-08 Kaz Kojima <kkojima@gcc.gnu.org> 2009-06-08 Kaz Kojima <kkojima@gcc.gnu.org>
* config/sh/sh-protos.h (sh_optimization_options): Declare. * config/sh/sh-protos.h (sh_optimization_options): Declare.
......
2009-06-09 Martin Jambor <mjambor@suse.cz>
* testsuite/gcc.c-torture/compile/pr40351.c: New file.
2009-06-09 Olivier Hainque <hainque@adacore.com> 2009-06-09 Olivier Hainque <hainque@adacore.com>
* gnat.dg/align_max.adb: New test. * gnat.dg/align_max.adb: New test.
......
/* PR tree-optimizations/40351 */
struct IO_APIC_route_entry {
unsigned int vector : 8;
unsigned int delivery_mode : 1;
unsigned int mask : 1;
unsigned int __reserved_2 : 15;
unsigned int __reserved_3 : 8;
} __attribute__ ((packed));
union entry_union {
struct {
unsigned int w1, w2;
};
struct IO_APIC_route_entry entry;
};
unsigned int io_apic_read(void);
struct IO_APIC_route_entry ioapic_read_entry(void)
{
union entry_union eu;
eu.w1 = io_apic_read();
return eu.entry;
}
...@@ -1544,6 +1544,13 @@ propagate_subacesses_accross_link (struct access *lacc, struct access *racc) ...@@ -1544,6 +1544,13 @@ propagate_subacesses_accross_link (struct access *lacc, struct access *racc)
continue; continue;
} }
/* If a (part of) a union field in on the RHS of an assignment, it can
have sub-accesses which do not make sense on the LHS (PR 40351).
Check that this is not the case. */
if (!build_ref_for_offset (NULL, TREE_TYPE (lacc->base), norm_offset,
rchild->type, false))
continue;
new_acc = create_artificial_child_access (lacc, rchild, norm_offset); new_acc = create_artificial_child_access (lacc, rchild, norm_offset);
if (racc->first_child) if (racc->first_child)
propagate_subacesses_accross_link (new_acc, rchild); propagate_subacesses_accross_link (new_acc, rchild);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment