public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] rs6000: plug a leak
@ 2012-08-22 22:54 Steven Bosscher
  2012-08-22 23:40 ` William J. Schmidt
  2012-08-23 14:45 ` William J. Schmidt
  0 siblings, 2 replies; 3+ messages in thread
From: Steven Bosscher @ 2012-08-22 22:54 UTC (permalink / raw)
  To: William J. Schmidt; +Cc: GCC Patches

Hello Bill,

This patch plugs a leak in rs6000.c:rs6000_density_test(). You have to
free the array that get_loop_body returns. Noticed while going over
all uses of get_loop_body (it's a common mistake to leak the return
array).

Patch is completely untested because I don't know when/how this
function is used. You've added this function:

2012-07-31  Bill Schmidt  <...>

        * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): Revise
        costs for vec_perm and vec_promote_demote down to more natural values.
        (struct _rs6000_cost_data): New data structure.
-->        (rs6000_density_test): New function

so I suppose you know what it's for and how to test this patch :-)

Could you test this for me and commit it if nothing strange happens?

Thanks,

Ciao!
Steven



Index: config/rs6000/rs6000.c
===================================================================
--- config/rs6000/rs6000.c      (revision 190601)
+++ config/rs6000/rs6000.c      (working copy)
@@ -3509,6 +3509,7 @@ rs6000_density_test (rs6000_cost_data *d
            not_vec_cost++;
        }
     }
+  free (bbs);

   density_pct = (vec_cost * 100) / (vec_cost + not_vec_cost);

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

* Re: [patch] rs6000: plug a leak
  2012-08-22 22:54 [patch] rs6000: plug a leak Steven Bosscher
@ 2012-08-22 23:40 ` William J. Schmidt
  2012-08-23 14:45 ` William J. Schmidt
  1 sibling, 0 replies; 3+ messages in thread
From: William J. Schmidt @ 2012-08-22 23:40 UTC (permalink / raw)
  To: Steven Bosscher; +Cc: GCC Patches

On Thu, 2012-08-23 at 00:53 +0200, Steven Bosscher wrote:
> Hello Bill,
> 
> This patch plugs a leak in rs6000.c:rs6000_density_test(). You have to
> free the array that get_loop_body returns. Noticed while going over
> all uses of get_loop_body (it's a common mistake to leak the return
> array).
> 
> Patch is completely untested because I don't know when/how this
> function is used. You've added this function:
> 
> 2012-07-31  Bill Schmidt  <...>
> 
>         * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): Revise
>         costs for vec_perm and vec_promote_demote down to more natural values.
>         (struct _rs6000_cost_data): New data structure.
> -->        (rs6000_density_test): New function
> 
> so I suppose you know what it's for and how to test this patch :-)
> 
> Could you test this for me and commit it if nothing strange happens?

Sure thing!  Thanks for catching this.

Bill

> 
> Thanks,
> 
> Ciao!
> Steven
> 
> 
> 
> Index: config/rs6000/rs6000.c
> ===================================================================
> --- config/rs6000/rs6000.c      (revision 190601)
> +++ config/rs6000/rs6000.c      (working copy)
> @@ -3509,6 +3509,7 @@ rs6000_density_test (rs6000_cost_data *d
>             not_vec_cost++;
>         }
>      }
> +  free (bbs);
> 
>    density_pct = (vec_cost * 100) / (vec_cost + not_vec_cost);
> 

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

* Re: [patch] rs6000: plug a leak
  2012-08-22 22:54 [patch] rs6000: plug a leak Steven Bosscher
  2012-08-22 23:40 ` William J. Schmidt
@ 2012-08-23 14:45 ` William J. Schmidt
  1 sibling, 0 replies; 3+ messages in thread
From: William J. Schmidt @ 2012-08-23 14:45 UTC (permalink / raw)
  To: Steven Bosscher; +Cc: GCC Patches, dje.gcc

On Thu, 2012-08-23 at 00:53 +0200, Steven Bosscher wrote:
> Hello Bill,
> 
> This patch plugs a leak in rs6000.c:rs6000_density_test(). You have to
> free the array that get_loop_body returns. Noticed while going over
> all uses of get_loop_body (it's a common mistake to leak the return
> array).
> 
> Patch is completely untested because I don't know when/how this
> function is used. You've added this function:
> 
> 2012-07-31  Bill Schmidt  <...>
> 
>         * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): Revise
>         costs for vec_perm and vec_promote_demote down to more natural values.
>         (struct _rs6000_cost_data): New data structure.
> -->        (rs6000_density_test): New function
> 
> so I suppose you know what it's for and how to test this patch :-)
> 
> Could you test this for me and commit it if nothing strange happens?

Hi Steven,

Regstrapped with no additional failures on powerpc64-unknown-linux-gnu.
Built CPU2006 without error.  Committed as obvious.

Thanks again,
Bill

> 
> Thanks,
> 
> Ciao!
> Steven
> 
> 
> 
> Index: config/rs6000/rs6000.c
> ===================================================================
> --- config/rs6000/rs6000.c      (revision 190601)
> +++ config/rs6000/rs6000.c      (working copy)
> @@ -3509,6 +3509,7 @@ rs6000_density_test (rs6000_cost_data *d
>             not_vec_cost++;
>         }
>      }
> +  free (bbs);
> 
>    density_pct = (vec_cost * 100) / (vec_cost + not_vec_cost);
> 

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

end of thread, other threads:[~2012-08-23 14:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-22 22:54 [patch] rs6000: plug a leak Steven Bosscher
2012-08-22 23:40 ` William J. Schmidt
2012-08-23 14:45 ` William J. Schmidt

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).