Hi!

On Sat, Mar 07, 2020 at 06:12:45PM +0100, J.W. Jagersma wrote:
> The following patch extends the generation of exception handling
> information to cover volatile asms too.  This was already mostly
> implemented, and only minor changes are required in order to make it
> work.

This should wait for stage 1, IMO.  Looks pretty good to me, thanks!
Some comments:

> +When non-call exceptions (@option{-fnon-call-exceptions}) are enabled, a
> +@code{volatile asm} statement is also allowed to throw exceptions.  If it
> +does, then the compiler assumes that its output operands have not been 
> written
> +yet.

That reads as if the compiler assumes the outputs retain their original
value, but that isn't true (I hope!)  The compiler assumes the output
are clobbered, but it doesn't assume they are assigned any definite
value?

> +  try
> +    {
> +      asm ("ud2");
> +    }

Yeah that won't work on other than x86.  Maybe you want to use something
like gc.dg/nop.h?  You could use what __builtin_trap generates, but you
want asm of course.

> +++ b/gcc/tree-eh.c
> @@ -2077,6 +2077,8 @@ lower_eh_constructs_2 (struct leh_state *state, 
> gimple_stmt_iterator *gsi)
> +    record_throwing_stmt:
>        /* Look for things that can throw exceptions, and record them.  */
>        if (state->cur_region && stmt_could_throw_p (cfun, stmt))

The indent of the label is incorrect (it should be flush left, but some
emacs users like one space, instead; same indent as the case labels
isn't correct).


Segher

Reply via email to