diff options
author | Tom de Vries <tom@codesourcery.com> | 2011-09-06 10:02:41 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2011-09-06 10:02:41 +0000 |
commit | 1255c03ad53e732fb5abe39878429c30e758e701 (patch) | |
tree | 7bfad37c59195cfe748e3c0016b11f6589952ce4 /gcc | |
parent | df1771759c3df941c6bbf0fc991f4937ac64bf68 (diff) | |
download | gcc-1255c03ad53e732fb5abe39878429c30e758e701.zip gcc-1255c03ad53e732fb5abe39878429c30e758e701.tar.gz gcc-1255c03ad53e732fb5abe39878429c30e758e701.tar.bz2 |
recog.c (asm_labels_ok): New function.
2011-09-06 Tom de Vries <tom@codesourcery.com>
* recog.c (asm_labels_ok): New function.
(check_asm_operands): Use asm_labels_ok.
From-SVN: r178580
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/recog.c | 22 |
2 files changed, 27 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b8c0c4e..a88e2dc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-09-06 Tom de Vries <tom@codesourcery.com> + + * recog.c (asm_labels_ok): New function. + (check_asm_operands): Use asm_labels_ok. + 2011-09-05 Richard Sandiford <rdsandiford@googlemail.com> PR target/49606 diff --git a/gcc/recog.c b/gcc/recog.c index 22a5402..d3ecb73 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -118,6 +118,25 @@ init_recog (void) } +/* Return true if labels in asm operands BODY are LABEL_REFs. */ + +static bool +asm_labels_ok (rtx body) +{ + rtx asmop; + int i; + + asmop = extract_asm_operands (body); + if (asmop == NULL_RTX) + return true; + + for (i = 0; i < ASM_OPERANDS_LABEL_LENGTH (asmop); i++) + if (GET_CODE (ASM_OPERANDS_LABEL (asmop, i)) != LABEL_REF) + return false; + + return true; +} + /* Check that X is an insn-body for an `asm' with operands and that the operands mentioned in it are legitimate. */ @@ -129,6 +148,9 @@ check_asm_operands (rtx x) const char **constraints; int i; + if (!asm_labels_ok (x)) + return 0; + /* Post-reload, be more strict with things. */ if (reload_completed) { |