aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-02-18 14:13:43 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2017-02-18 14:13:43 +0100
commitc26159516d6a16def440628643d8c1b7c43169c3 (patch)
tree563f1063c7dd530b04363f81d35d56101e643e7c /gcc
parentdc15bc7ad6f46550b5df09d9a85f6180a76ae8ce (diff)
downloadgcc-c26159516d6a16def440628643d8c1b7c43169c3.zip
gcc-c26159516d6a16def440628643d8c1b7c43169c3.tar.gz
gcc-c26159516d6a16def440628643d8c1b7c43169c3.tar.bz2
re PR target/79559 (ICE in ix86_print_operand, at config/i386/i386.c:18189)
PR target/79559 * config/i386/i386.c (ix86_print_operand): Use output_operand_lossage instead of gcc_assert for K, r and R code checks. Formatting fixes. * gcc.target/i386/pr79559.c: New test. From-SVN: r245560
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/i386/i386.c42
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/i386/pr79559.c11
4 files changed, 49 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 53cd408..90e6d1f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2017-02-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/79559
+ * config/i386/i386.c (ix86_print_operand): Use output_operand_lossage
+ instead of gcc_assert for K, r and R code checks. Formatting fixes.
+
2017-02-17 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR target/79261
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index a1c084f..fb0dca2 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -17847,8 +17847,8 @@ ix86_print_operand (FILE *file, rtx x, int code)
break;
default:
- output_operand_lossage
- ("invalid operand size for operand code 'O'");
+ output_operand_lossage ("invalid operand size for operand "
+ "code 'O'");
return;
}
@@ -17882,15 +17882,14 @@ ix86_print_operand (FILE *file, rtx x, int code)
return;
default:
- output_operand_lossage
- ("invalid operand size for operand code 'z'");
+ output_operand_lossage ("invalid operand size for operand "
+ "code 'z'");
return;
}
}
if (GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT)
- warning
- (0, "non-integer operand used with operand code 'z'");
+ warning (0, "non-integer operand used with operand code 'z'");
/* FALLTHRU */
case 'Z':
@@ -17952,13 +17951,12 @@ ix86_print_operand (FILE *file, rtx x, int code)
}
else
{
- output_operand_lossage
- ("invalid operand type used with operand code 'Z'");
+ output_operand_lossage ("invalid operand type used with "
+ "operand code 'Z'");
return;
}
- output_operand_lossage
- ("invalid operand size for operand code 'Z'");
+ output_operand_lossage ("invalid operand size for operand code 'Z'");
return;
case 'd':
@@ -18157,7 +18155,12 @@ ix86_print_operand (FILE *file, rtx x, int code)
break;
case 'K':
- gcc_assert (CONST_INT_P (x));
+ if (!CONST_INT_P (x))
+ {
+ output_operand_lossage ("operand is not an integer, invalid "
+ "operand code 'K'");
+ return;
+ }
if (INTVAL (x) & IX86_HLE_ACQUIRE)
#ifdef HAVE_AS_IX86_HLE
@@ -18180,8 +18183,12 @@ ix86_print_operand (FILE *file, rtx x, int code)
return;
case 'r':
- gcc_assert (CONST_INT_P (x));
- gcc_assert (INTVAL (x) == ROUND_SAE);
+ if (!CONST_INT_P (x) || INTVAL (x) != ROUND_SAE)
+ {
+ output_operand_lossage ("operand is not a specific integer, "
+ "invalid operand code 'r'");
+ return;
+ }
if (ASSEMBLER_DIALECT == ASM_INTEL)
fputs (", ", file);
@@ -18194,7 +18201,12 @@ ix86_print_operand (FILE *file, rtx x, int code)
return;
case 'R':
- gcc_assert (CONST_INT_P (x));
+ if (!CONST_INT_P (x))
+ {
+ output_operand_lossage ("operand is not an integer, invalid "
+ "operand code 'R'");
+ return;
+ }
if (ASSEMBLER_DIALECT == ASM_INTEL)
fputs (", ", file);
@@ -18309,7 +18321,7 @@ ix86_print_operand (FILE *file, rtx x, int code)
return;
default:
- output_operand_lossage ("invalid operand code '%c'", code);
+ output_operand_lossage ("invalid operand code '%c'", code);
}
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 035cf47..b4edfe8 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2017-02-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/79559
+ * gcc.target/i386/pr79559.c: New test.
+
2017-02-17 Joseph Myers <joseph@codesourcery.com>
* gcc.dg/c11-float-2.c: New test.
diff --git a/gcc/testsuite/gcc.target/i386/pr79559.c b/gcc/testsuite/gcc.target/i386/pr79559.c
new file mode 100644
index 0000000..2eeb652
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr79559.c
@@ -0,0 +1,11 @@
+/* PR target/79559 */
+/* { dg-do compile } */
+
+void
+foo (int x)
+{
+ __asm__ volatile ("# %K0" : : "r" (x)); /* { dg-error "invalid operand code" } */
+ __asm__ volatile ("# %r0" : : "r" (x)); /* { dg-error "invalid operand code" } */
+ __asm__ volatile ("# %r0" : : "n" (129)); /* { dg-error "invalid operand code" } */
+ __asm__ volatile ("# %R0" : : "r" (x)); /* { dg-error "invalid operand code" } */
+}