From a8fb934809eee4113f6ec425430387873c2cc30c Mon Sep 17 00:00:00 2001 From: rth Date: Tue, 2 Apr 2002 08:35:51 +0000 Subject: PR opt/190 * final.c (this_is_asm_operands): Export. * output.h (this_is_asm_operands): Declare. * config/i386/i386.c (print_operand): Error odd asm operands. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51741 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/config/i386/i386.c | 2 ++ gcc/final.c | 2 +- gcc/output.h | 5 +++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c1eeba49bbd..8fa21c47724 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2002-04-02 Richard Henderson + + PR opt/190 + * final.c (this_is_asm_operands): Export. + * output.h (this_is_asm_operands): Declare. + * config/i386/i386.c (print_operand): Error odd asm operands. + 2002-04-02 Richard Henderson PR opt/420 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index f36495eeae5..adb8048b56a 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -5995,6 +5995,8 @@ print_operand (file, x, code) else if (CONSTANT_ADDRESS_P (x) && code =='P' && GET_CODE (x) != CONST_INT) output_addr_const (file, x); + else if (this_is_asm_operands && ! address_operand (x, VOIDmode)) + output_operand_lossage ("invalid constraints for operand"); else output_address (x); } diff --git a/gcc/final.c b/gcc/final.c index 47dd4555644..4992cedaeb6 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -122,7 +122,7 @@ extern int length_unit_log; /* This is defined in insn-attrtab.c. */ /* Nonzero while outputting an `asm' with operands. This means that inconsistencies are the user's fault, so don't abort. The precise value is the insn being output, to pass to error_for_asm. */ -static rtx this_is_asm_operands; +rtx this_is_asm_operands; /* Number of operands of this insn, for an `asm' with operands. */ static unsigned int insn_noperands; diff --git a/gcc/output.h b/gcc/output.h index 9c7adaff98c..3f8872a1c3b 100644 --- a/gcc/output.h +++ b/gcc/output.h @@ -465,6 +465,11 @@ extern struct rtx_def *current_insn_predicate; /* Last insn processed by final_scan_insn. */ extern struct rtx_def *current_output_insn; +/* Nonzero while outputting an `asm' with operands. + This means that inconsistencies are the user's fault, so don't abort. + The precise value is the insn being output, to pass to error_for_asm. */ +extern rtx this_is_asm_operands; + /* Decide whether DECL needs to be in a writable section. RELOC is the same as for SELECT_SECTION. */ -- cgit v1.2.3