On Thu, May 26, 2011 at 09:26:58AM -0400, Jason Merrill wrote: > On 05/26/2011 06:32 AM, Jakub Jelinek wrote: > >gimplify_cond_expr knows how to gimplify this, but shortcut_cond_r > >tried to optimize > >if (a ? b : throw 1) goto yes; else goto no; > >into > >if (a) > > if (b) goto yes; else goto no; > >else > > if (throw 1) goto yes; else goto no; > >which ICEs or errors out. Fixed by not trying to optimize > >such COND_EXPRs. > > Why not optimize them to > > if (!a) > throw 1; > if (b) goto yes; else goto no; > > ?
That is how it ends up being optimized later on, I just think given how long the bug has been in this is so rare that we don't need to try to optimize it already at the gimplifier level. Jakub