From d51a6714b93b8a3c85e69003d74782140cd9b763 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 21 May 2015 21:17:28 +0200 Subject: [PATCH] re PR tree-optimization/66233 (internal compiler error: in expand_fix, at optabs.c:5358) PR tree-optimization/66233 * match.pd (ocvt (icvt@1 @0)): Don't handle vector types. Simplify. * gcc.c-torture/execute/pr66233.c: New test. From-SVN: r223500 --- gcc/ChangeLog | 6 +++++ gcc/match.pd | 14 +++++------- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.c-torture/execute/pr66233.c | 22 +++++++++++++++++++ 4 files changed, 38 insertions(+), 9 deletions(-) create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr66233.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 48472bc92b0..a74a7ad8c2c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-05-21 Jakub Jelinek + + PR tree-optimization/66233 + * match.pd (ocvt (icvt@1 @0)): Don't handle vector types. + Simplify. + 2015-05-21 Jeff Law * config/pa/pa.md (add-with-constant splitter): Use ASHIFT rather diff --git a/gcc/match.pd b/gcc/match.pd index ce628531136..73ccfbd4b00 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -730,16 +730,12 @@ along with GCC; see the file COPYING3. If not see (for integers). Avoid this if the final type is a pointer since then we sometimes need the middle conversion. Likewise if the final type has a precision not equal to the size of its mode. */ - (if (((inter_int && inside_int) - || (inter_float && inside_float) - || (inter_vec && inside_vec)) + (if (((inter_int && inside_int) || (inter_float && inside_float)) + && (final_int || final_float) && inter_prec >= inside_prec - && (inter_float || inter_vec - || inter_unsignedp == inside_unsignedp) - && ! (final_prec != GET_MODE_PRECISION (element_mode (type)) - && element_mode (type) == element_mode (inter_type)) - && ! final_ptr - && (! final_vec || inter_prec == inside_prec)) + && (inter_float || inter_unsignedp == inside_unsignedp) + && ! (final_prec != GET_MODE_PRECISION (TYPE_MODE (type)) + && TYPE_MODE (type) == TYPE_MODE (inter_type))) (ocvt @0)) /* If we have a sign-extension of a zero-extended value, we can diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 73a3e569210..e5083f65bf1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-05-21 Jakub Jelinek + + PR tree-optimization/66233 + * gcc.c-torture/execute/pr66233.c: New test. + 2015-05-21 Thomas Koenig PR fortran/66176 diff --git a/gcc/testsuite/gcc.c-torture/execute/pr66233.c b/gcc/testsuite/gcc.c-torture/execute/pr66233.c new file mode 100644 index 00000000000..b0d63b68584 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr66233.c @@ -0,0 +1,22 @@ +/* PR tree-optimization/66233 */ + +unsigned int v[8]; + +__attribute__((noinline, noclone)) void +foo (void) +{ + int i; + for (i = 0; i < 8; i++) + v[i] = (float) i; +} + +int +main () +{ + unsigned int i; + foo (); + for (i = 0; i < 8; i++) + if (v[i] != i) + __builtin_abort (); + return 0; +} -- 2.30.2