On Thu, 5 May 2016, Bernd Edlinger wrote:

> Hi!
> 
> this patch is inspired by recent discussion about basic asm:
> 
> Currently a basic asm is an instruction scheduling barrier,
> but not a memory barrier, and most surprising, basic asm
> does _not_ implicitly clobber CC on targets where
> extended asm always implicitly clobbers CC, even if
> nothing is in the clobber section.
> 
> This patch makes basic asm implicitly clobber CC on certain
> targets, and makes the basic asm implicitly clobber memory,
> but no general registers, which is what could be expected.
> 
> This is however only done for basic asm with non-empty
> assembler string, which is in sync with David's proposed
> basic asm warnings patch.
> 
> Due to the change in the tree representation, where
> ASM_INPUT can now be the first element of a
> PARALLEL block with the implicit clobber elements,
> there are some changes necessary.
> 
> Most of the changes in the middle end, were necessary
> because extract_asm_operands can not be used to find out
> if a PARALLEL block is an asm statement, but in most cases
> asm_noperands can be used instead.
> 
> There are also changes necessary in two targets: pa, and ia64.
> I have successfully built cross-compilers for these targets.
> 
> Boot-strapped and reg-tested on x86_64-pc-linux-gnu
> OK for trunk?

I'm generally sympathetic with the change but I wonder if it would
make sense to re-write "basic asm" into general asms to not
need to special case them.  I'd do that during gimplification
for example.

At least it sounds to me that its semantics can be fully expressed
with generic asms?  (Maybe apart from the only-if-ASM_STRING-is-empty
part)

Thanks,
Richard.

Reply via email to