https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65551

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That tree-ssa-sccvn.c change is just bogus.
TYPE_PRECISION meaning is dependent on what the type is.
For INTEGRAL_TYPE_P it supposedly does what you want, haven't checked the
details.  Not so sure already about scalar floating point types, why should the
precision be relevant?  But, e.g. for the complex types, TYPE_PRECISION is just
0, for vector types it is log2 of TYPE_VECT_SUBPARTS, etc.
So if TYPE_PRECISION is really what you want for INTEGRAL_TYPE_P, supposedly
--- gcc/tree-ssa-sccvn.c    2015-02-10 22:58:23.572010447 +0100
+++ gcc/tree-ssa-sccvn.c    2015-03-26 13:58:41.145949566 +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;

?

Reply via email to