Commit cd76ea33 by Richard Kenner

(expand_asm_operands): Disallow matching constraints on output and

validate the numbers on inputs.

From-SVN: r13077
parent c6258ee2
...@@ -1453,13 +1453,12 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) ...@@ -1453,13 +1453,12 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
#endif #endif
break; break;
case 'p': case 'g': case 'r':
/* Whether or not a numeric constraint allows a register is
decided by the matching constraint, and so there is no need
to do anything special with them. We must handle them in
the default case, so that we don't unnecessarily force
operands to memory. */
case '0': case '1': case '2': case '3': case '4': case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
error ("matching constraint not valid in output operand");
break;
case 'p': case 'g': case 'r':
default: default:
allows_reg = 1; allows_reg = 1;
break; break;
...@@ -1564,13 +1563,20 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) ...@@ -1564,13 +1563,20 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
#endif #endif
break; break;
case 'p': case 'g': case 'r':
/* Whether or not a numeric constraint allows a register is /* Whether or not a numeric constraint allows a register is
decided by the matching constraint, and so there is no need decided by the matching constraint, and so there is no need
to do anything special with them. We must handle them in to do anything special with them. We must handle them in
the default case, so that we don't unnecessarily force the default case, so that we don't unnecessarily force
operands to memory. */ operands to memory. */
case '0': case '1': case '2': case '3': case '4': case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
if (TREE_STRING_POINTER (TREE_PURPOSE (tail))[j]
>= '0' + noutputs)
error ("matching constraint references invalid operand number");
/* ... fall through ... */
case 'p': case 'g': case 'r':
default: default:
allows_reg = 1; allows_reg = 1;
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment