public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] No SRA debug replacements for variables that cannot be removed
@ 2013-01-15 15:52 Martin Jambor
  2013-01-15 16:05 ` Jakub Jelinek
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Jambor @ 2013-01-15 15:52 UTC (permalink / raw)
  To: GCC Patches

Hi,

as discussed in PR 55920, this patch prevents SRA from creating debug
replacements and debug statements for aggregate variables which cannot
be scalarized away.  Jakub bootstrapped and tested the patch and I
suppose he is OK with it too so I will commit is shortly.

Thanks,

Martin


2013-01-11  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/55920
	* tree-sra.c (analyze_access_subtree): Do not mark non-removable
	accesses as grp_to_be_debug_replaced.

Index: src/gcc/tree-sra.c
===================================================================
--- src.orig/gcc/tree-sra.c
+++ src/gcc/tree-sra.c
@@ -2199,7 +2199,9 @@ analyze_access_subtree (struct access *r
     {
       if (allow_replacements
 	  && scalar && !root->first_child
-	  && (root->grp_scalar_write || root->grp_assignment_write))
+	  && (root->grp_scalar_write || root->grp_assignment_write)
+	  && !bitmap_bit_p (cannot_scalarize_away_bitmap,
+			    DECL_UID (root->base)))
 	{
 	  gcc_checking_assert (!root->grp_scalar_read
 			       && !root->grp_assignment_read);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] No SRA debug replacements for variables that cannot be removed
  2013-01-15 15:52 [PATCH] No SRA debug replacements for variables that cannot be removed Martin Jambor
@ 2013-01-15 16:05 ` Jakub Jelinek
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Jelinek @ 2013-01-15 16:05 UTC (permalink / raw)
  To: GCC Patches

On Tue, Jan 15, 2013 at 04:52:16PM +0100, Martin Jambor wrote:
> 2013-01-11  Martin Jambor  <mjambor@suse.cz>
> 
> 	PR tree-optimization/55920
> 	* tree-sra.c (analyze_access_subtree): Do not mark non-removable
> 	accesses as grp_to_be_debug_replaced.

Ok, thanks.

> --- src.orig/gcc/tree-sra.c
> +++ src/gcc/tree-sra.c
> @@ -2199,7 +2199,9 @@ analyze_access_subtree (struct access *r
>      {
>        if (allow_replacements
>  	  && scalar && !root->first_child
> -	  && (root->grp_scalar_write || root->grp_assignment_write))
> +	  && (root->grp_scalar_write || root->grp_assignment_write)
> +	  && !bitmap_bit_p (cannot_scalarize_away_bitmap,
> +			    DECL_UID (root->base)))
>  	{
>  	  gcc_checking_assert (!root->grp_scalar_read
>  			       && !root->grp_assignment_read);

	Jakub

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-15 16:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-15 15:52 [PATCH] No SRA debug replacements for variables that cannot be removed Martin Jambor
2013-01-15 16:05 ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).