Re: [PATCH] Miscompilation of __attribute__((constructor)) functions.

2011-10-31 Thread Paul Brook
> Ok if you move the clearing to after > > /* Generate a new name for the new version. */ > DECL_NAME (new_decl) = clone_function_name (old_decl, clone_name); > SET_DECL_ASSEMBLER_NAME (new_decl, DECL_NAME (new_decl)); > SET_DECL_RTL (new_decl, NULL); > > using new_decl directly, thus add

Re: [PATCH] Miscompilation of __attribute__((constructor)) functions.

2011-10-28 Thread Richard Guenther
On Thu, Oct 27, 2011 at 7:24 PM, Paul Brook wrote: > Patch below fixes a miscompilation observed whem building uclibc libpthread on > a mips-linux system. > > The story start with the ipa-split optimization, which turns: > > void fn() > { >  if (cond) { >    DO_STUFF; >  } > } > > into: > > static

[PATCH] Miscompilation of __attribute__((constructor)) functions.

2011-10-27 Thread Paul Brook
Patch below fixes a miscompilation observed whem building uclibc libpthread on a mips-linux system. The story start with the ipa-split optimization, which turns: void fn() { if (cond) { DO_STUFF; } } into: static void fn_helper() { DO_STUFF; } void fn() { if (cond) fn_helper()