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]

Re: [PATCH, PR 40554] Fix BIT_FIELD_REF handling


On Tue, 30 Jun 2009, Martin Jambor wrote:

> 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?

Ok.

Thanks,
Richard.

> 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;
> 
> 

-- 
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex


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