aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2018-04-07 23:52:03 +0000
committerThomas Koenig <tkoenig@gcc.gnu.org>2018-04-07 23:52:03 +0000
commitf913ff2adc41a6f8dec64efffbbfb3ee9bb4464b (patch)
tree2a8701b4c6ab1c4378abbf0c65d5ddf552ee37cd
parent7c75d64658039682e0d2bd73c81b0adc88677115 (diff)
downloadgcc-f913ff2adc41a6f8dec64efffbbfb3ee9bb4464b.zip
gcc-f913ff2adc41a6f8dec64efffbbfb3ee9bb4464b.tar.gz
gcc-f913ff2adc41a6f8dec64efffbbfb3ee9bb4464b.tar.bz2
re PR middle-end/82976 (Error: non-trivial conversion at assignment since r254526)
2018-04-07 Thomas Koenig <tkoenig@gcc.gnu.org> Andrew Pinski <pinsika@gcc.gnu.org> PR middle-end/82976 * match.pd: Use constant_boolean_node of correct type instead of boolean_true_node or boolean_false_node for simplifying pointer comparisons to zero. 2018-04-07 Thomas Koenig <tkoenig@gcc.gnu.org> PR middle-end/82976 * gfortran.dg/realloc_on_assign_16a.f90: New test. Co-Authored-By: Andrew Pinski <pinskia@gcc.gnu.org> From-SVN: r259212
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/match.pd2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/realloc_on_assign_16a.f9029
4 files changed, 43 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a263974..2430cce 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2018-04-07 Thomas Koenig <tkoenig@gcc.gnu.org>
+ Andrew Pinski <pinsika@gcc.gnu.org>
+
+ PR middle-end/82976
+ * match.pd: Use constant_boolean_node of correct type instead of
+ boolean_true_node or boolean_false_node for simplifying
+ pointer comparisons to zero.
+
2018-04-07 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/80021
diff --git a/gcc/match.pd b/gcc/match.pd
index 02753c0..1bbf09f 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -3700,7 +3700,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(neeq @0 @1)
(if (POINTER_TYPE_P (TREE_TYPE (@0))
&& ptrs_compare_unequal (@0, @1))
- { neeq == EQ_EXPR ? boolean_false_node : boolean_true_node; })))
+ { constant_boolean_node (neeq != EQ_EXPR, type); })))
/* PR70920: Transform (intptr_t)x eq/ne CST to x eq/ne (typeof x) CST.
and (typeof ptr_cst) x eq/ne ptr_cst to x eq/ne (typeof x) CST.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 00ac96f..08a80f1 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2018-04-07 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR middle-end/82976
+ * gfortran.dg/realloc_on_assign_16a.f90: New test.
+
2018-04-07 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/85257
diff --git a/gcc/testsuite/gfortran.dg/realloc_on_assign_16a.f90 b/gcc/testsuite/gfortran.dg/realloc_on_assign_16a.f90
new file mode 100644
index 0000000..9d16d6c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/realloc_on_assign_16a.f90
@@ -0,0 +1,29 @@
+! { dg-do compile }
+! { dg-options "-Ofast -fno-tree-forwprop" }
+! Test that PR 82976 is fixed, this used to ICE.
+!
+! Contributed by Stefan Mauerberger <stefan.mauerberger@gmail.com>
+!
+PROGRAM main
+ !USE MPI
+
+ TYPE :: test_typ
+ REAL, ALLOCATABLE :: a(:)
+ END TYPE
+
+ TYPE(test_typ) :: xx, yy
+ TYPE(test_typ), ALLOCATABLE :: conc(:)
+
+ !CALL MPI_INIT(i)
+
+ xx = test_typ( [1.0,2.0] )
+ yy = test_typ( [4.0,4.9] )
+
+ conc = [ xx, yy ]
+
+ if (any (int (10.0*conc(1)%a) .ne. [10,20])) STOP 1
+ if (any (int (10.0*conc(2)%a) .ne. [40,49])) STOP 2
+
+ !CALL MPI_FINALIZE(i)
+
+END PROGRAM main