public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix matrix regression failures on AIX and HP-UX
@ 2007-07-26 14:08 Razya Ladelsky
  2007-07-26 14:30 ` Diego Novillo
  0 siblings, 1 reply; 7+ messages in thread
From: Razya Ladelsky @ 2007-07-26 14:08 UTC (permalink / raw)
  To: gcc-patches; +Cc: sje, David Edelsohn, Ayal Zaks

[-- Attachment #1: Type: text/plain, Size: 657 bytes --]

Hi,

This patch solves the matrix regression failures
that were reported in http://gcc.gnu.org/ml/gcc/2007-07/msg00426.html

The problem was referring to an unallocated space. I also added
initialization for the matrix fields (to be on the safe side).

Tested on matrix suite for PPC Linux and AIX.
Steve, will you check it on your machine as well, as I 
don't have such machine here?

O.k. for mainline once passes full testing?

Thanks,
Razya

2007-07-26  Razya Ladelsky  <razya@il.ibm.com>

        * matrix-reorg.c (analyze_matrix_decl): Initialize matrix fields.
         (analyze_matrix_allocation_site): Avoid referring to an 
unallocated space.





[-- Attachment #2: matrix.diff --]
[-- Type: application/octet-stream, Size: 1151 bytes --]

Index: matrix-reorg.c
===================================================================
*** matrix-reorg.c	(revision 126845)
--- matrix-reorg.c	(working copy)
*************** analyze_matrix_decl (tree var_decl)
*** 530,535 ****
--- 530,536 ----
    /* Record the matrix.  */
  
    m_node = (struct matrix_info *) xcalloc (1, sizeof (struct matrix_info));
+   memset (m_node, 0, sizeof (struct matrix_info)); 
    m_node->decl = var_decl;
    m_node->num_dims = dim_num;
    m_node->free_stmts
*************** analyze_matrix_allocation_site (struct m
*** 823,829 ****
  	     call in this indirection level; if so, mark it; if not, mark
  	     as escaping.  */
  	  if (mi->malloc_for_level
! 	      && mi->malloc_for_level[level]
  	      && mi->malloc_for_level[level] != stmt)
  	    {
  	      mark_min_matrix_escape_level (mi, level, stmt);
--- 824,830 ----
  	     call in this indirection level; if so, mark it; if not, mark
  	     as escaping.  */
  	  if (mi->malloc_for_level
! 	      && mi->max_malloced_level-1 == level
  	      && mi->malloc_for_level[level] != stmt)
  	    {
  	      mark_min_matrix_escape_level (mi, level, stmt);

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

* Re: [PATCH] Fix matrix regression failures on AIX and HP-UX
  2007-07-26 14:08 [PATCH] Fix matrix regression failures on AIX and HP-UX Razya Ladelsky
@ 2007-07-26 14:30 ` Diego Novillo
  2007-07-27 18:23   ` Steve Ellcey
  2007-07-29 10:14   ` Razya Ladelsky
  0 siblings, 2 replies; 7+ messages in thread
From: Diego Novillo @ 2007-07-26 14:30 UTC (permalink / raw)
  To: Razya Ladelsky; +Cc: gcc-patches, sje, David Edelsohn, Ayal Zaks

On 7/26/07 9:07 AM, Razya Ladelsky wrote:

>     m_node = (struct matrix_info *) xcalloc (1, sizeof (struct matrix_info));
> +   memset (m_node, 0, sizeof (struct matrix_info)); 

Not necessary.  You are allocating with xcalloc.


>   	     call in this indirection level; if so, mark it; if not, mark
>   	     as escaping.  */
>   	  if (mi->malloc_for_level
> ! 	      && mi->max_malloced_level-1 == level

I don't get this one.  Why are we marking level as escaping if level+1
is malloc'd?

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

* Re: [PATCH] Fix matrix regression failures on AIX and HP-UX
  2007-07-26 14:30 ` Diego Novillo
@ 2007-07-27 18:23   ` Steve Ellcey
  2007-07-29  9:58     ` Razya Ladelsky
  2007-07-29 10:14   ` Razya Ladelsky
  1 sibling, 1 reply; 7+ messages in thread
From: Steve Ellcey @ 2007-07-27 18:23 UTC (permalink / raw)
  To: RAZYA; +Cc: gcc-patches, edelsohn, ZAKS

FYI:  I put the if part of the patch (&& mi->max_malloced_level-1 ==
level) in my local sources and left out the memset and my matrix test
failures all went away on HP-UX.

Steve Ellcey
sje@cup.hp.com

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

* Re: [PATCH] Fix matrix regression failures on AIX and HP-UX
  2007-07-27 18:23   ` Steve Ellcey
@ 2007-07-29  9:58     ` Razya Ladelsky
  0 siblings, 0 replies; 7+ messages in thread
From: Razya Ladelsky @ 2007-07-29  9:58 UTC (permalink / raw)
  To: Steve Ellcey; +Cc: Ayal Zaks, edelsohn, gcc-patches

Steve Ellcey <sje@cup.hp.com> wrote on 27/07/2007 20:58:01:

> FYI:  I put the if part of the patch (&& mi->max_malloced_level-1 ==
> level) in my local sources and left out the memset and my matrix test
> failures all went away on HP-UX.
> 

Good. The if part is the part solving the problems.
As Diego commented, the memset part is unnecessary when xcalloc is used.

Thanks,
Razya



> Steve Ellcey
> sje@cup.hp.com

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

* Re: [PATCH] Fix matrix regression failures on AIX and HP-UX
  2007-07-26 14:30 ` Diego Novillo
  2007-07-27 18:23   ` Steve Ellcey
@ 2007-07-29 10:14   ` Razya Ladelsky
  2007-07-30 13:05     ` Diego Novillo
  1 sibling, 1 reply; 7+ messages in thread
From: Razya Ladelsky @ 2007-07-29 10:14 UTC (permalink / raw)
  To: Diego Novillo; +Cc: Ayal Zaks, David Edelsohn, gcc-patches, sje

Diego Novillo <dnovillo@google.com> wrote on 26/07/2007 17:22:47:

> On 7/26/07 9:07 AM, Razya Ladelsky wrote:
> 
> >     m_node = (struct matrix_info *) xcalloc (1, sizeof (struct 
> matrix_info));
> > +   memset (m_node, 0, sizeof (struct matrix_info)); 
> 
> Not necessary.  You are allocating with xcalloc.
> 
O.k.
I wasn't sure about that. Thanks.

> 
> >           call in this indirection level; if so, mark it; if not, mark
> >           as escaping.  */
> >        if (mi->malloc_for_level
> > !          && mi->max_malloced_level-1 == level
> 
> I don't get this one.  Why are we marking level as escaping if level+1
> is malloc'd?
> 
the statement that is being analyzed here is a mallco statement of level 
'level'.
If mi->max_malloced_level-1 == level, it means that we've seen a malloc 
statement of level 'level' before.
If the statement is not the same one that we've seen before, then there's 
another malloc statement for the same level, which means that we need to
mark it escaping.

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

* Re: [PATCH] Fix matrix regression failures on AIX and HP-UX
  2007-07-29 10:14   ` Razya Ladelsky
@ 2007-07-30 13:05     ` Diego Novillo
  2007-07-30 13:18       ` Razya Ladelsky
  0 siblings, 1 reply; 7+ messages in thread
From: Diego Novillo @ 2007-07-30 13:05 UTC (permalink / raw)
  To: Razya Ladelsky; +Cc: Ayal Zaks, David Edelsohn, gcc-patches, sje

On 7/29/07 4:33 AM, Razya Ladelsky wrote:

> the statement that is being analyzed here is a mallco statement of level 
> 'level'.
> If mi->max_malloced_level-1 == level, it means that we've seen a malloc 
> statement of level 'level' before.
> If the statement is not the same one that we've seen before, then there's 
> another malloc statement for the same level, which means that we need to
> mark it escaping.

Ah, now it's clearer.  Could you add this comment to the code?  The
patch is fine with that addition.


Thanks.

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

* Re: [PATCH] Fix matrix regression failures on AIX and HP-UX
  2007-07-30 13:05     ` Diego Novillo
@ 2007-07-30 13:18       ` Razya Ladelsky
  0 siblings, 0 replies; 7+ messages in thread
From: Razya Ladelsky @ 2007-07-30 13:18 UTC (permalink / raw)
  To: Diego Novillo; +Cc: Ayal Zaks, David Edelsohn, gcc-patches, sje

Diego Novillo <dnovillo@google.com> wrote on 30/07/2007 15:43:12:

> On 7/29/07 4:33 AM, Razya Ladelsky wrote:
> 
> > the statement that is being analyzed here is a mallco statement of 
level 
> > 'level'.
> > If mi->max_malloced_level-1 == level, it means that we've seen a 
malloc 
> > statement of level 'level' before.
> > If the statement is not the same one that we've seen before, then 
there's 
> > another malloc statement for the same level, which means that we need 
to
> > mark it escaping.
> 
> Ah, now it's clearer.  Could you add this comment to the code?  The
> patch is fine with that addition.
> 

Sure, I will.

Thanks,
Razya


> 
> Thanks.

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

end of thread, other threads:[~2007-07-30 12:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-26 14:08 [PATCH] Fix matrix regression failures on AIX and HP-UX Razya Ladelsky
2007-07-26 14:30 ` Diego Novillo
2007-07-27 18:23   ` Steve Ellcey
2007-07-29  9:58     ` Razya Ladelsky
2007-07-29 10:14   ` Razya Ladelsky
2007-07-30 13:05     ` Diego Novillo
2007-07-30 13:18       ` Razya Ladelsky

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