aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMichael Meissner <gnu@the-meissners.org>2009-01-14 22:40:34 +0000
committerMichael Meissner <meissner@gcc.gnu.org>2009-01-14 22:40:34 +0000
commit6df6bcfa0fde9cc6413088d609f799188444f51b (patch)
treee276f7fae07e10ebc5a0ff65c5c7ea2a7df68ab9 /gcc
parent3e55cc6f7c4e97f38555873046f6b3880f102a25 (diff)
downloadgcc-6df6bcfa0fde9cc6413088d609f799188444f51b.zip
gcc-6df6bcfa0fde9cc6413088d609f799188444f51b.tar.gz
gcc-6df6bcfa0fde9cc6413088d609f799188444f51b.tar.bz2
Fix PR22599
From-SVN: r143386
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/i386/i386.c40
2 files changed, 40 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1f67c45..dff3716 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2009-01-14 Michael Meissner <gnu@the-meissners.org>
+
+ PR target/22599
+ * i386.c (print_operand): Add tests for 'D', 'C', 'F', 'f' to make
+ sure the insn is a conditional test (bug 22599). Reformat a few long
+ lines.
+
2009-01-14 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/38431
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index b5fea23..d02f5c1 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -10834,7 +10834,8 @@ print_operand (FILE *file, rtx x, int code)
fputs ("ord", file);
break;
default:
- gcc_unreachable ();
+ output_operand_lossage ("operand is not a condition code, invalid operand code 'D'");
+ return;
}
}
else
@@ -10872,7 +10873,8 @@ print_operand (FILE *file, rtx x, int code)
fputs ("ord", file);
break;
default:
- gcc_unreachable ();
+ output_operand_lossage ("operand is not a condition code, invalid operand code 'D'");
+ return;
}
}
return;
@@ -10894,9 +10896,23 @@ print_operand (FILE *file, rtx x, int code)
#endif
return;
case 'C':
+ if (!COMPARISON_P (x))
+ {
+ output_operand_lossage ("operand is neither a constant nor a "
+ "condition code, invalid operand code "
+ "'C'");
+ return;
+ }
put_condition_code (GET_CODE (x), GET_MODE (XEXP (x, 0)), 0, 0, file);
return;
case 'F':
+ if (!COMPARISON_P (x))
+ {
+ output_operand_lossage ("operand is neither a constant nor a "
+ "condition code, invalid operand code "
+ "'F'");
+ return;
+ }
#ifdef HAVE_AS_IX86_CMOV_SUN_SYNTAX
if (ASSEMBLER_DIALECT == ASM_ATT)
putc ('.', file);
@@ -10909,13 +10925,22 @@ print_operand (FILE *file, rtx x, int code)
/* Check to see if argument to %c is really a constant
and not a condition code which needs to be reversed. */
if (!COMPARISON_P (x))
- {
- output_operand_lossage ("operand is neither a constant nor a condition code, invalid operand code 'c'");
- return;
- }
+ {
+ output_operand_lossage ("operand is neither a constant nor a "
+ "condition code, invalid operand "
+ "code 'c'");
+ return;
+ }
put_condition_code (GET_CODE (x), GET_MODE (XEXP (x, 0)), 1, 0, file);
return;
case 'f':
+ if (!COMPARISON_P (x))
+ {
+ output_operand_lossage ("operand is neither a constant nor a "
+ "condition code, invalid operand "
+ "code 'f'");
+ return;
+ }
#ifdef HAVE_AS_IX86_CMOV_SUN_SYNTAX
if (ASSEMBLER_DIALECT == ASM_ATT)
putc ('.', file);
@@ -11022,7 +11047,8 @@ print_operand (FILE *file, rtx x, int code)
fputs ("une", file);
break;
default:
- gcc_unreachable ();
+ output_operand_lossage ("operand is not a condition code, invalid operand code 'D'");
+ return;
}
return;