This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, PR 40554] Fix BIT_FIELD_REF handling


Hi,

the patch below  fixes PR 40554.  The problem  is that sra_modify_expr
passed wrong start_ofset  to generate_subtree_copies when dealing with
a BIT_FIELD_REF that has a component_ref as the zeroth parameter.

Unfortunately I have not been able to come up with a simple testcase
for the testsuite.

Bootstrapped and tested on x86_64-linux, OK for trunk?

Thanks,

Martin


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

	PR middle-end/40554
	* tree-sra.c (sra_modify_expr): Add access->offset to start_offset.

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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]