From 93671519e202e3bc5ab592bb6318aa738e4ae58f Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Mon, 6 Jun 2016 12:31:59 +0000 Subject: re PR c/24414 (Old-style asms don't clobber memory) gcc/ 2016-06-06 Bernd Edlinger PR c/24414 * cfgexpand.c (expand_asm_loc): Remove handling for ADDR_EXPR. Implicitly clobber memory for basic asm with non-empty assembler string. Use targetm.md_asm_adjust also here. * compare-elim.c (arithmetic_flags_clobber_p): Use asm_noperands here. * final.c (final_scan_insn): Handle basic asm in PARALLEL block. * gimple.c (gimple_asm_clobbers_memory_p): Handle basic asm with non-empty assembler string. * ira.c (compute_regs_asm_clobbered): Use asm_noperands here. * recog.c (asm_noperands): Handle basic asm in PARALLEL block. (decode_asm_operands): Handle basic asm in PARALLEL block. (extract_insn): Handle basic asm in PARALLEL block. * doc/extend.texi: Mention new behavior of basic asm. * config/ia64/ia64 (rtx_needs_barrier): Handle ASM_INPUT here. * config/pa/pa.c (branch_to_delay_slot_p, branch_needs_nop_p, branch_needs_nop_p): Use asm_noperands. gcc/testsuite/ 2016-06-06 Bernd Edlinger PR c/24414 * gcc.target/i386/pr24414.c: New test. From-SVN: r237133 --- gcc/doc/extend.texi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gcc/doc/extend.texi') diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index c85e6db..7208f33 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -7581,7 +7581,7 @@ means there is no way to communicate to the compiler what is happening inside them. GCC has no visibility of symbols in the @code{asm} and may discard them as unreferenced. It also does not know about side effects of the assembler code, such as modifications to memory or registers. Unlike -some compilers, GCC assumes that no changes to either memory or registers +some compilers, GCC assumes that no changes to general purpose registers occur. This assumption may change in a future release. To avoid complications from future changes to the semantics and the @@ -7605,6 +7605,10 @@ all basic @code{asm} blocks use the assembler dialect specified by the Basic @code{asm} provides no mechanism to provide different assembler strings for different dialects. +For basic @code{asm} with non-empty assembler string GCC assumes +the assembler block does not change any general purpose registers, +but it may read or write any globally accessible variable. + Here is an example of basic @code{asm} for i386: @example -- cgit v1.1