> > What is the reason why lowering for SJLJ exceptions is not done in GIMPLE? > > Because it completely wrecks loops because we factor the SJLJ site, > thus > > fn () > { > ... > for (;;) > { > try { X } catch { Y } > } > > becomes > > fn () > { > if (setjmp ()) > { > switch (...) > ... goto L; > } > for (;;) > { > X; > L: > Y; > }
Well, if SJLJ lowering happens as gimple pass somewhere near the end of gimple queue, this should not be problem at all. (and implementation would be cleaner) Honza