From: Richard Stallman Date: Wed, 26 May 1993 03:50:44 +0000 (+0000) Subject: (expand_asm_operands): Detect constants as outputs. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e619bb8d4bc756193b9586bba2c2e99f3157e033;p=gcc.git (expand_asm_operands): Detect constants as outputs. From-SVN: r4569 --- 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); }