summaryrefslogtreecommitdiffstats
path: root/gcc/stmt.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-09 11:13:07 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-09 11:13:07 +0000
commitc52051b716a51ee83229fba4d24ad52806b809f1 (patch)
tree111c11b5a4cc31685a7092d95fa33e235dc2f666 /gcc/stmt.c
parentaadef98cada4d40b053e548cb75e9a01b193ae92 (diff)
downloadppe42-gcc-c52051b716a51ee83229fba4d24ad52806b809f1.tar.gz
ppe42-gcc-c52051b716a51ee83229fba4d24ad52806b809f1.zip
PR inline-asm/8832
* tree.h (expand_asm): New prototype. * stmt.c (expand_asm): Set the MEM_VOLATILE_P flag if instructed to do so. * c-semantics (genrtl_asm_stmt): Pass the RID_VOLATILE qualifier down to expand_asm. * c-typeck.c (simple_asm_stmt): Set the RID_VOLATILE qualifier. * rtlanal.c (volatile_insn_p) [ASM_INPUT]: Test the MEM_VOLATILE_P flag. (volatile_refs_p) [ASM_INPUT]: Likewise. (side_effects_p) [ASM_INPUT]: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61099 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r--gcc/stmt.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index fbdf463ee57..ac0aa15bef2 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -1098,18 +1098,26 @@ n_occurrences (c, s)
}
/* Generate RTL for an asm statement (explicit assembler code).
- BODY is a STRING_CST node containing the assembler code text,
- or an ADDR_EXPR containing a STRING_CST. */
+ STRING is a STRING_CST node containing the assembler code text,
+ or an ADDR_EXPR containing a STRING_CST. VOL nonzero means the
+ insn is volatile; don't optimize it. */
void
-expand_asm (body)
- tree body;
+expand_asm (string, vol)
+ tree string;
+ int vol;
{
- if (TREE_CODE (body) == ADDR_EXPR)
- body = TREE_OPERAND (body, 0);
+ rtx body;
+
+ if (TREE_CODE (string) == ADDR_EXPR)
+ string = TREE_OPERAND (string, 0);
+
+ body = gen_rtx_ASM_INPUT (VOIDmode, TREE_STRING_POINTER (string));
+
+ MEM_VOLATILE_P (body) = vol;
- emit_insn (gen_rtx_ASM_INPUT (VOIDmode,
- TREE_STRING_POINTER (body)));
+ emit_insn (body);
+
clear_last_expr ();
}
OpenPOWER on IntegriCloud