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]

[patch] [tuples] small fix for gimple_assign_set_rhs_with_ops


When reallocating, gimple_assign_set_rhs_with_ops currently doesn't
allocate space for the lhs of an assignment. The attached patch fixes
the bug.


2008-01-29  Rafael Espindola  <espindola@google.com>
            * gimple.c (gimple_assign_set_rhs_with_ops): Allocate
right number of ops.

Cheers,
-- 
Rafael Avila de Espindola

Google Ireland Ltd.
Gordon House
Barrow Street
Dublin 4
Ireland

Registered in Dublin, Ireland
Registration Number: 368047
commit 124e5397ab2e1a5be09be5116f4566afd865c9b4
Author: Rafael Espindola <espindola@google.com>
Date:   Tue Jan 29 14:39:40 2008 +0000

    fix gimple_assign_set_rhs_with_ops

diff --git a/gcc/gimple.c b/gcc/gimple.c
index 2a1e151..a3685e5 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -1566,7 +1566,7 @@ gimple_assign_set_rhs_with_ops (gimple stmt, enum tree_code code, tree op1,
   if (get_gimple_rhs_num_ops (gimple_assign_subcode (stmt)) != num_ops)
     {
       tree lhs = gimple_assign_lhs (stmt);
-      gimple_alloc_ops (stmt, num_ops);
+      gimple_alloc_ops (stmt, num_ops + 1); /* +1 for the lhs */
       gimple_assign_set_lhs (stmt, lhs);
     }
 

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