[PATCH] Fix to IPCP code to resolve a regression

Diego Novillo dnovillo@redhat.com
Thu Nov 10 12:58:00 GMT 2005


On Thursday 10 November 2005 03:09, Razya Ladelsky wrote:

>         * ipa-prop.c: Removed obsolete type checking.
>
ChangeLog entry is misformatted.  You need to specify each function in the 
file and what changed.  The patch itself looks fine.

In ipa-cp.c:constant_val_insert it'd be safer to use fold_convert to adjust 
for minor type variations (like the short/int that was causing you grief 
earlier).  Something like this:

Index: ipa-cp.c
===================================================================
--- ipa-cp.c    (revision 106714)
+++ ipa-cp.c    (working copy)
@@ -446,7 +446,8 @@ constant_val_insert (tree fn, tree parm1
   edge e_step;
   edge_iterator ei;

-  init_stmt = build2 (MODIFY_EXPR, void_type_node, parm1, val);
+  init_stmt = build2 (MODIFY_EXPR, void_type_node, parm1,
+                     fold_convert (TREE_TYPE (parm1), val));
   func = DECL_STRUCT_FUNCTION (fn);
   cfun = func;
   current_function_decl = fn;



More information about the Gcc-patches mailing list