aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-05-26 03:50:44 +0000
committerRichard Stallman <rms@gnu.org>1993-05-26 03:50:44 +0000
commite619bb8d4bc756193b9586bba2c2e99f3157e033 (patch)
tree26be9ee5c3c54d4d80a3d164ed4af16d3739374b
parent09b11d829e344c3da800e8a98273073da752179f (diff)
downloadgcc-e619bb8d4bc756193b9586bba2c2e99f3157e033.zip
gcc-e619bb8d4bc756193b9586bba2c2e99f3157e033.tar.gz
gcc-e619bb8d4bc756193b9586bba2c2e99f3157e033.tar.bz2
(expand_asm_operands): Detect constants as outputs.
From-SVN: r4569
-rw-r--r--gcc/stmt.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 05b0738..737e217 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);
}