* [patch][tuples] fix warning
@ 2008-02-21 11:23 Rafael Espindola
2008-02-21 14:26 ` Diego Novillo
0 siblings, 1 reply; 4+ messages in thread
From: Rafael Espindola @ 2008-02-21 11:23 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 370 bytes --]
The attached patch fixes an uninitialized variable warning. Committed
as obvious.
2008-02-21 Rafael Espindola <espindola@google.com>
* tree-tailcall.c (adjust_accumulator_values): Initialize phi.
Cheers,
--
Rafael Avila de Espindola
Google Ireland Ltd.
Gordon House
Barrow Street
Dublin 4
Ireland
Registered in Dublin, Ireland
Registration Number: 368047
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix.patch --]
[-- Type: text/x-patch; name=fix.patch, Size: 491 bytes --]
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c
index 32ebed1..cc6394b 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -527,7 +527,7 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
static void
adjust_accumulator_values (gimple_stmt_iterator bsi, tree m, tree a, edge back)
{
- gimple stmt, phi;
+ gimple stmt, phi = NULL;
tree var, tmp;
tree ret_type = TREE_TYPE (DECL_RESULT (current_function_decl));
tree a_acc_arg = a_acc, m_acc_arg = m_acc;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch][tuples] fix warning
2008-02-21 11:23 [patch][tuples] fix warning Rafael Espindola
@ 2008-02-21 14:26 ` Diego Novillo
2008-02-21 15:46 ` Rafael Espindola
0 siblings, 1 reply; 4+ messages in thread
From: Diego Novillo @ 2008-02-21 14:26 UTC (permalink / raw)
To: Rafael Espindola; +Cc: gcc-patches
On 2/21/08 6:18 AM, Rafael Espindola wrote:
> The attached patch fixes an uninitialized variable warning. Committed
> as obvious.
>
> 2008-02-21 Rafael Espindola <espindola@google.com>
>
> * tree-tailcall.c (adjust_accumulator_values): Initialize phi.
PHI should be initialized before each of those loops in the function
body. The call to add_phi_arg looks like it's always expecting the
block to have PHI nodes, and that we actually found a PHI node. Please
put an assert before that and initialize PHI before each loop.
The file hasn't been converted yet, so I guess it's not too important atm.
Thanks. Diego.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch][tuples] fix warning
2008-02-21 14:26 ` Diego Novillo
@ 2008-02-21 15:46 ` Rafael Espindola
2008-02-21 16:00 ` Diego Novillo
0 siblings, 1 reply; 4+ messages in thread
From: Rafael Espindola @ 2008-02-21 15:46 UTC (permalink / raw)
To: Diego Novillo; +Cc: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 612 bytes --]
> PHI should be initialized before each of those loops in the function
> body. The call to add_phi_arg looks like it's always expecting the
> block to have PHI nodes, and that we actually found a PHI node. Please
> put an assert before that and initialize PHI before each loop.
>
> The file hasn't been converted yet, so I guess it's not too important atm.
Please review the attached patch. It is compiling right now.
>
> Thanks. Diego.
>
Thanks,
--
Rafael Avila de Espindola
Google Ireland Ltd.
Gordon House
Barrow Street
Dublin 4
Ireland
Registered in Dublin, Ireland
Registration Number: 368047
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix.patch --]
[-- Type: text/x-patch; name=fix.patch, Size: 1361 bytes --]
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c
index cc6394b..ab539d0 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -527,7 +527,7 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
static void
adjust_accumulator_values (gimple_stmt_iterator bsi, tree m, tree a, edge back)
{
- gimple stmt, phi = NULL;
+ gimple stmt, phi;
tree var, tmp;
tree ret_type = TREE_TYPE (DECL_RESULT (current_function_decl));
tree a_acc_arg = a_acc, m_acc_arg = m_acc;
@@ -577,6 +577,7 @@ adjust_accumulator_values (gimple_stmt_iterator bsi, tree m, tree a, edge back)
if (a_acc)
{
phis = phi_nodes (back->dest);
+ phi = NULL;
for (psi = gsi_start (phis); !gsi_end_p (psi); gsi_next (&psi))
{
phi = gsi_stmt (psi);
@@ -584,12 +585,14 @@ adjust_accumulator_values (gimple_stmt_iterator bsi, tree m, tree a, edge back)
break;
}
+ gcc_assert (phi != NULL);
add_phi_arg (phi, a_acc_arg, back);
}
if (m_acc)
{
phis = phi_nodes (back->dest);
+ phi = NULL;
for (psi = gsi_start (phis); !gsi_end_p (psi); gsi_next (&psi))
{
phi = gsi_stmt (psi);
@@ -597,6 +600,7 @@ adjust_accumulator_values (gimple_stmt_iterator bsi, tree m, tree a, edge back)
break;
}
+ gcc_assert (phi != NULL);
add_phi_arg (phi, m_acc_arg, back);
}
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch][tuples] fix warning
2008-02-21 15:46 ` Rafael Espindola
@ 2008-02-21 16:00 ` Diego Novillo
0 siblings, 0 replies; 4+ messages in thread
From: Diego Novillo @ 2008-02-21 16:00 UTC (permalink / raw)
To: Rafael Espindola; +Cc: gcc-patches
On 2/21/08 9:25 AM, Rafael Espindola wrote:
> Please review the attached patch. It is compiling right now.
Looks good. Thanks.
Diego.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-02-21 14:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-21 11:23 [patch][tuples] fix warning Rafael Espindola
2008-02-21 14:26 ` Diego Novillo
2008-02-21 15:46 ` Rafael Espindola
2008-02-21 16:00 ` Diego Novillo
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).