diff options
author | Richard Henderson <rth@cygnus.com> | 1998-10-26 05:33:07 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 1998-10-26 05:33:07 -0800 |
commit | 3fbd5c2cfd1abfe548156e87901c9c1802566c06 (patch) | |
tree | c09ae6f0110582acadb55c81214522cbf8adbcf2 /gcc | |
parent | 386c8529ddcd9d50f52ff12eec084dee39a6eb1d (diff) | |
download | gcc-3fbd5c2cfd1abfe548156e87901c9c1802566c06.zip gcc-3fbd5c2cfd1abfe548156e87901c9c1802566c06.tar.gz gcc-3fbd5c2cfd1abfe548156e87901c9c1802566c06.tar.bz2 |
* stmt.c (expand_asm_operands): Accept `=' or `+' at any position.
From-SVN: r23356
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/stmt.c | 23 |
2 files changed, 25 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6aedcb2..f7265a6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +Mon Oct 26 13:32:31 1998 Richard Henderson <rth@cygnus.com> + + * stmt.c (expand_asm_operands): Accept `=' or `+' at any position. + Mon Oct 26 12:53:14 1998 Jeffrey A Law (law@cygnus.com) * tm.texi (ASM_OUTPUT_MAX_SKIP_ALIGN): Document. @@ -1230,6 +1230,7 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) tree val = TREE_VALUE (tail); tree type = TREE_TYPE (val); char *constraint; + char *p; int c_len; int j; int is_inout = 0; @@ -1247,13 +1248,31 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) c_len = TREE_STRING_LENGTH (TREE_PURPOSE (tail)) - 1; constraint = TREE_STRING_POINTER (TREE_PURPOSE (tail)); - if (c_len == 0 - || (constraint[0] != '=' && constraint[0] != '+')) + /* Allow the `=' or `+' to not be at the beginning of the string, + since it wasn't explicitly documented that way, and there is a + large body of code that puts it last. Swap the character to + the front, so as not to uglify any place else. */ + switch (c_len) { + default: + if ((p = strchr (constraint, '=')) != NULL) + break; + if ((p = strchr (constraint, '+')) != NULL) + break; + case 0: error ("output operand constraint lacks `='"); return; } + if (p != constraint) + { + j = *p; + bcopy (constraint, constraint+1, p-constraint); + *constraint = j; + + warning ("output constraint `%c' for operand %d is not at the beginning", j, i); + } + is_inout = constraint[0] == '+'; /* Replace '+' with '='. */ constraint[0] = '='; |