From 4c1da8ea3e05208b006b1fb926a02fed7df05e5f Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 5 Apr 2018 20:35:16 +0200 Subject: [PATCH] re PR middle-end/85195 (ICE: verify_gimple failed: non-trivial conversion at assignment with -O -fno-tree-ccp --param=sccvn-max-scc-size=10) PR middle-end/85195 * match.pd (BIT_FIELD_REF CONSTRUCTOR@0 @1 @2): Use view_convert around CONSTRUCTOR_ELT (ctor, ...)->value. * gcc.dg/pr85195.c: New test. From-SVN: r259149 --- gcc/ChangeLog | 6 ++++++ gcc/match.pd | 4 ++-- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr85195.c | 19 +++++++++++++++++++ 4 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/pr85195.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index be9c255a4b6..c9c538b716b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-04-05 Jakub Jelinek + + PR middle-end/85195 + * match.pd (BIT_FIELD_REF CONSTRUCTOR@0 @1 @2): Use view_convert around + CONSTRUCTOR_ELT (ctor, ...)->value. + 2018-04-05 Uros Bizjak PR target/85193 diff --git a/gcc/match.pd b/gcc/match.pd index 7c4c11c4ef7..02753c0f85c 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -4650,7 +4650,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) { build_constructor (type, NULL); } (if (count == 1) (if (elt < CONSTRUCTOR_NELTS (ctor)) - { CONSTRUCTOR_ELT (ctor, elt)->value; } + (view_convert { CONSTRUCTOR_ELT (ctor, elt)->value; }) { build_zero_cst (type); }) { vec *vals; @@ -4668,7 +4668,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (if (CONSTRUCTOR_NELTS (ctor) <= idx / const_k) { build_zero_cst (type); }) (if (n == const_k) - { CONSTRUCTOR_ELT (ctor, idx / const_k)->value; }) + (view_convert { CONSTRUCTOR_ELT (ctor, idx / const_k)->value; })) (BIT_FIELD_REF { CONSTRUCTOR_ELT (ctor, idx / const_k)->value; } @1 { bitsize_int ((idx % const_k) * width); }))))))))) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1acfe0c89ea..d6a9738a177 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-04-05 Jakub Jelinek + + PR middle-end/85195 + * gcc.dg/pr85195.c: New test. + 2018-04-05 Paolo Carlini PR c++/80956 diff --git a/gcc/testsuite/gcc.dg/pr85195.c b/gcc/testsuite/gcc.dg/pr85195.c new file mode 100644 index 00000000000..0cc696ba6ee --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr85195.c @@ -0,0 +1,19 @@ +/* PR middle-end/85195 */ +/* { dg-do compile { target int128 } } */ +/* { dg-options "-Wno-psabi -O -fno-tree-ccp --param=sccvn-max-scc-size=10" } */ + +typedef __int128 V __attribute__ ((vector_size (16))); + +extern int bar (V); + +V v; +int i; + +V +foo (void) +{ + do + v *= bar (v & i); + while ((V){}[0]); + return v; +} -- 2.30.2