aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-12-07 18:06:08 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2017-12-07 18:06:08 +0100
commit47f5f7e74920fe65f5ebe4737a9c70c34178990a (patch)
tree52e7af29d835cac01723efb893f24b7b38586c00 /gcc
parent5d9ae53d70c72991e26648d915e7fb8e00b8e811 (diff)
downloadgcc-47f5f7e74920fe65f5ebe4737a9c70c34178990a.zip
gcc-47f5f7e74920fe65f5ebe4737a9c70c34178990a.tar.gz
gcc-47f5f7e74920fe65f5ebe4737a9c70c34178990a.tar.bz2
re PR middle-end/83164 (internal compiler error: verify_gimple failed)
PR middle-end/83164 * tree-cfg.c (verify_gimple_assign_binary): Don't require types_compatible_p, just that TYPE_MODE is the same. * gcc.c-torture/compile/pr83164.c: New test. From-SVN: r255470
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr83164.c7
-rw-r--r--gcc/tree-cfg.c4
4 files changed, 21 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f81665f..966810f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2017-12-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/83164
+ * tree-cfg.c (verify_gimple_assign_binary): Don't require
+ types_compatible_p, just that TYPE_MODE is the same.
+
2017-12-07 Martin Sebor <msebor@redhat.com>
PR c/81544
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 4a4406a..199cc28 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2017-12-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/83164
+ * gcc.c-torture/compile/pr83164.c: New test.
+
2017-12-07 Martin Sebor <msebor@redhat.com>
PR c/81544
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr83164.c b/gcc/testsuite/gcc.c-torture/compile/pr83164.c
new file mode 100644
index 0000000..e153e3b
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr83164.c
@@ -0,0 +1,7 @@
+/* PR middle-end/83164 */
+
+__PTRDIFF_TYPE__
+foo (void)
+{
+ return (char *) foo - (char *) 0x1230;
+}
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index e313df9..4d09b2c 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -4007,7 +4007,9 @@ verify_gimple_assign_binary (gassign *stmt)
{
if (!POINTER_TYPE_P (rhs1_type)
|| !POINTER_TYPE_P (rhs2_type)
- || !types_compatible_p (rhs1_type, rhs2_type)
+ /* Because we special-case pointers to void we allow difference
+ of arbitrary pointers with the same mode. */
+ || TYPE_MODE (rhs1_type) != TYPE_MODE (rhs2_type)
|| TREE_CODE (lhs_type) != INTEGER_TYPE
|| TYPE_UNSIGNED (lhs_type)
|| TYPE_PRECISION (lhs_type) != TYPE_PRECISION (rhs1_type))