PR tree-optimization/42703
* tree-sra.c (analyze_access_subtree): Check that we can build a
reference to the original data within the aggregate.
* testsuite/gcc.c-torture/compile/pr42703.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155863
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-01-13 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/42703
+ * tree-sra.c (analyze_access_subtree): Check that we can build a
+ reference to the original data within the aggregate.
+
2010-01-13 Richard Guenther <rguenther@suse.de>
PR tree-optimization/42705
+2010-01-13 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/42703
+ * testsuite/gcc.c-torture/compile/pr42703.c: New test.
+
2010-01-13 Richard Guenther <rguenther@suse.de>
PR tree-optimization/42705
--- /dev/null
+__extension__ typedef unsigned long long int uint64_t;
+typedef uint64_t ScmUInt64;
+void swapb64(ScmUInt64 *loc)
+{
+ union {
+ ScmUInt64 l;
+ unsigned char c[4];
+ } dd;
+ unsigned char t;
+ dd.l = *loc;
+ (t = dd.c[3], dd.c[3] = dd.c[4], dd.c[4] = t);
+}
if (allow_replacements && scalar && !root->first_child
&& (root->grp_hint
- || (direct_read && root->grp_write)))
+ || (direct_read && root->grp_write))
+ /* We must not ICE later on when trying to build an access to the
+ original data within the aggregate even when it is impossible to do in
+ a defined way like in the PR 42703 testcase. Therefore we check
+ pre-emptively here that we will be able to do that. */
+ && build_ref_for_offset (NULL, TREE_TYPE (root->base), root->offset,
+ root->type, false))
{
if (dump_file && (dump_flags & TDF_DETAILS))
{