diff options
author | Andreas Krebbel <Andreas.Krebbel@de.ibm.com> | 2010-11-26 14:07:16 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@gcc.gnu.org> | 2010-11-26 14:07:16 +0000 |
commit | 8395b41e9e5476e0e18f377d2f7f649a14a0c69c (patch) | |
tree | 8808c4f7cc5a2fc862d2bbde505c3ce0b3d3c634 /gcc | |
parent | 1b2bb17149a53bf7af1ede24b1ad431525b093b8 (diff) | |
download | gcc-8395b41e9e5476e0e18f377d2f7f649a14a0c69c.zip gcc-8395b41e9e5476e0e18f377d2f7f649a14a0c69c.tar.gz gcc-8395b41e9e5476e0e18f377d2f7f649a14a0c69c.tar.bz2 |
s390.c (print_operand_address): Replace assert with error message.
2010-11-26 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* config/s390/s390.c (print_operand_address): Replace assert with
error message.
(print_operand): Replace assertions, gcc_unreachable and
fatal_insn with error messages.
From-SVN: r167177
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/s390/s390.c | 79 |
2 files changed, 67 insertions, 19 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a92635c..26694ac 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2010-11-26 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> + + * config/s390/s390.c (print_operand_address): Replace assert with + error message. + (print_operand): Replace assertions, gcc_unreachable and + fatal_insn with error messages. + 2010-11-26 Richard Guenther <rguenther@suse.de> PR tree-optimization/46665 diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index cdf8c21..2580723 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -5130,7 +5130,11 @@ print_operand_address (FILE *file, rtx addr) if (s390_symref_operand_p (addr, NULL, NULL)) { - gcc_assert (TARGET_Z10); + if (!TARGET_Z10) + { + error ("symbolic memory references are only supported on z10 or later"); + return; + } output_addr_const (file, addr); return; } @@ -5197,7 +5201,7 @@ print_operand (FILE *file, rtx x, int code) else if (GET_CODE (x) == GT) fprintf (file, "h"); else - gcc_unreachable (); + error ("invalid comparison operator for 'E' output modifier"); return; case 'J': @@ -5217,7 +5221,7 @@ print_operand (FILE *file, rtx x, int code) assemble_name (file, get_some_local_dynamic_name ()); } else - gcc_unreachable (); + error ("invalid reference for 'J' output modifier"); return; case 'G': @@ -5229,11 +5233,21 @@ print_operand (FILE *file, rtx x, int code) struct s390_address ad; int ret; - gcc_assert (GET_CODE (x) == MEM); + if (!MEM_P (x)) + { + error ("memory reference expected for 'O' output modifier"); + return; + } + ret = s390_decompose_address (XEXP (x, 0), &ad); - gcc_assert (ret); - gcc_assert (!ad.base || REGNO_OK_FOR_BASE_P (REGNO (ad.base))); - gcc_assert (!ad.indx); + + if (!ret + || (ad.base && !REGNO_OK_FOR_BASE_P (REGNO (ad.base))) + || ad.indx) + { + error ("invalid address for 'O' output modifier"); + return; + } if (ad.disp) output_addr_const (file, ad.disp); @@ -5247,11 +5261,21 @@ print_operand (FILE *file, rtx x, int code) struct s390_address ad; int ret; - gcc_assert (GET_CODE (x) == MEM); + if (!MEM_P (x)) + { + error ("memory reference expected for 'R' output modifier"); + return; + } + ret = s390_decompose_address (XEXP (x, 0), &ad); - gcc_assert (ret); - gcc_assert (!ad.base || REGNO_OK_FOR_BASE_P (REGNO (ad.base))); - gcc_assert (!ad.indx); + + if (!ret + || (ad.base && !REGNO_OK_FOR_BASE_P (REGNO (ad.base))) + || ad.indx) + { + error ("invalid address for 'R' output modifier"); + return; + } if (ad.base) fprintf (file, "%s", reg_names[REGNO (ad.base)]); @@ -5265,11 +5289,20 @@ print_operand (FILE *file, rtx x, int code) struct s390_address ad; int ret; - gcc_assert (GET_CODE (x) == MEM); + if (!MEM_P (x)) + { + error ("memory reference expected for 'S' output modifier"); + return; + } ret = s390_decompose_address (XEXP (x, 0), &ad); - gcc_assert (ret); - gcc_assert (!ad.base || REGNO_OK_FOR_BASE_P (REGNO (ad.base))); - gcc_assert (!ad.indx); + + if (!ret + || (ad.base && !REGNO_OK_FOR_BASE_P (REGNO (ad.base))) + || ad.indx) + { + error ("invalid address for 'S' output modifier"); + return; + } if (ad.disp) output_addr_const (file, ad.disp); @@ -5287,7 +5320,7 @@ print_operand (FILE *file, rtx x, int code) else if (GET_CODE (x) == MEM) x = change_address (x, VOIDmode, plus_constant (XEXP (x, 0), 4)); else - gcc_unreachable (); + error ("register or memory expression expected for 'N' output modifier"); break; case 'M': @@ -5296,7 +5329,7 @@ print_operand (FILE *file, rtx x, int code) else if (GET_CODE (x) == MEM) x = change_address (x, VOIDmode, plus_constant (XEXP (x, 0), 8)); else - gcc_unreachable (); + error ("register or memory expression expected for 'M' output modifier"); break; case 'Y': @@ -5357,11 +5390,19 @@ print_operand (FILE *file, rtx x, int code) else if (code == 'h') fprintf (file, HOST_WIDE_INT_PRINT_DEC, ((CONST_DOUBLE_LOW (x) & 0xffff) ^ 0x8000) - 0x8000); else - gcc_unreachable (); + { + if (code == 0) + error ("invalid constant - try using an output modifier"); + else + error ("invalid constant for output modifier '%c'", code); + } break; default: - fatal_insn ("UNKNOWN in print_operand !?", x); + if (code == 0) + error ("invalid expression - try using an output modifier"); + else + error ("invalid expression for output modifier '%c'", code); break; } } |