This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: What do do with the exceptional case of expand_case for SJLJ exceptions
> > 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