------- Comment #3 from jamborm at gcc dot gnu dot org 2009-06-27 23:41 -------
I believe the following (but yet untested) patch fixes this issue.
I will bootstrap and test it once I have a testcase that is simple
enough to be put into the testsuite. I hope to do all of this on
Monday.
Index: mine/gcc/tree-sra.c
===================================================================
--- mine.orig/gcc/tree-sra.c 2009-06-28 00:58:23.000000000 +0200
+++ mine/gcc/tree-sra.c 2009-06-28 01:00:34.000000000 +0200
@@ -1908,7 +1908,8 @@ sra_modify_expr (tree *expr, gimple_stmt
&& host_integerp (TREE_OPERAND (bfr, 2), 1))
{
chunk_size = tree_low_cst (TREE_OPERAND (bfr, 1), 1);
- start_offset = tree_low_cst (TREE_OPERAND (bfr, 2), 1);
+ start_offset = access->offset
+ + tree_low_cst (TREE_OPERAND (bfr, 2), 1);
}
else
start_offset = chunk_size = 0;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40554