On Fri, Jan 13, 2012 at 11:05:36AM +0100, Richard Guenther wrote: > This fixes the ICEs that occur with redeclared extern inline functions > in some circumstances. It avoids the cgraph confusion by _not_ merging > the two decls in this case but simply drops the old (extern inline) > one on the floor. This causes the cgraph to be properly presented > with two different decls and thus two different cgraph nodes will > be created. I didn't try to change name-lookup to always find > the extern inline copy to preserve the ever existing recursive > case > > extern __inline __attribute__ ((__always_inline__)) > void open () > { > } > void open () > { > open (); > } > > which even in 3.2 where the ICEs appearantly did not exist compiled > to a self-recursive open () (trivially explained by how 3.2 worked, > function-at-a-time).
That won't e.g. copy over any attributes from the extern inline to the out of line, or asm redirection, or type merging, etc. If you want to keep olddecl as is, then IMHO we should add a new bool argument to merge_decls and if the flag is set, make sure we only ever modify newdecl and not olddecl. Jakub