Hi, On Sun, Dec 18, 2011 at 01:57:17PM +1100, Matt Davis wrote: > I am using 'ipa_modify_formal_parameters()' to change the type of a function's > formal parameter. After my pass completes, I get a 'gimple_expand_cfg()' > error. I must be missing some key piece here, as the failure points to a NULL > "SA.partition_to_pseudo" value. I also set_default_ssa_name() on the returned > value from ipa_modify_formal_parameter (the adjustment's 'reduction' field). > Do > I need to re-gimplify the function or run some kind of 'cleanup' or 'update' > once I modify this formal parameter?
It's difficult to say without knowing what and at what stage of the compilation you are doing. The sad truth is that ipa_modify_formal_parameters is very much crafted for its sole user which is IPA-SRA and is probably quite less general than what the original intention was. Any pass using the function then must modify the body itself to reflect the changes, just like IPA-SRA does. SRA does not re-gimplify the modify functions, it just returns TODO_update_ssa or (TODO_update_ssa | TODO_cleanup_cfg) if any EH cleanup changed the CFG. So I would suggest to have a look at IPA-SRA (grep for the only call to ipa_modify_formal_parameters in tree-sra.c), especially at what you do differently. If you then have any further questions, feel free to ask. Martin