This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix loop_only_exit_p


> Ah, ok.  I dove into the code and that indeed seems to be the case.
> 
> Why is that function ignoring volatiles but not volatile asms or
> old-style asms?  I think the only control-flow transfer asms are
> allowed to make are asm gotos?

You mean
  if (gasm *asm_stmt = dyn_cast <gasm *> (t))
    if (gimple_asm_volatile_p (asm_stmt) || gimple_asm_input_p (asm_stmt))
      return true;
I was also bit puzzled by this conditional but I think it assumes that volatile
ASM can, for example, perform infinite loop and wait for asynchronous interrupt
to transfer control flow away.

It is of course undocumented but one may probably also try to throw exception by
hand (i.e. call throw())

The second conditional seems to be there because
asm("blah")
is old style asm that has implicit volatile on it.
> 
> Anyway, that's a pre-existing issue so the patch is ok.

Thanks,
Honza


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]