From e619bb8d4bc756193b9586bba2c2e99f3157e033 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Wed, 26 May 1993 03:50:44 +0000 Subject: [PATCH] (expand_asm_operands): Detect constants as outputs. From-SVN: r4569 --- gcc/stmt.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/stmt.c b/gcc/stmt.c index 05b0738f551..737e217fcf8 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -1146,7 +1146,15 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) if (TREE_CODE (val) != VAR_DECL && TREE_CODE (val) != PARM_DECL && TREE_CODE (val) != INDIRECT_REF) - TREE_VALUE (tail) = save_expr (TREE_VALUE (tail)); + { + TREE_VALUE (tail) = save_expr (TREE_VALUE (tail)); + /* If it's a constant, print error now so don't crash later. */ + if (TREE_CODE (TREE_VALUE (tail)) != SAVE_EXPR) + { + error ("invalid output in `asm'"); + return; + } + } output_rtx[i] = expand_expr (TREE_VALUE (tail), NULL_RTX, VOIDmode, 0); } -- 2.30.2