This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix sccvn non-integral type handling (PR tree-optimization/65551)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 26 Mar 2015 17:50:13 +0100
- Subject: [PATCH] Fix sccvn non-integral type handling (PR tree-optimization/65551)
- Authentication-results: sourceware.org; auth=none
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
This patch fixes
FAIL: 26_numerics/complex/50880.cc execution test
on powerpc64le-linux (and presumably arm*-linux-gnueabi) by basically
reverting the r220390 change for the case when ref->type is not
INTEGRAL_TYPE_P - otherwise TYPE_PRECISION on say complex type or
vector type means very different things than the patch expects.
Bootstrapped/regtested on powercp64le-linux, ok for trunk?
2015-03-26 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/65551
* tree-ssa-sccvn.c (fully_constant_vn_reference_p): Use
TYPE_PRECISION only for INTEGRAL_TYPE_P types.
--- gcc/tree-ssa-sccvn.c.jj 2015-02-10 22:58:23.000000000 +0100
+++ gcc/tree-ssa-sccvn.c 2015-03-26 14:41:44.078248811 +0100
@@ -1352,7 +1352,11 @@ fully_constant_vn_reference_p (vn_refere
|| TYPE_PRECISION (ref->type) % BITS_PER_UNIT == 0))
{
HOST_WIDE_INT off = 0;
- HOST_WIDE_INT size = TYPE_PRECISION (ref->type);
+ HOST_WIDE_INT size;
+ if (INTEGRAL_TYPE_P (ref->type))
+ size = TYPE_PRECISION (ref->type);
+ else
+ size = tree_to_shwi (TYPE_SIZE (ref->type));
if (size % BITS_PER_UNIT != 0
|| size > MAX_BITSIZE_MODE_ANY_MODE)
return NULL_TREE;
Jakub