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

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Simple patch to reproduce the issue:

Index: gcc/gimple-fold.c
===================================================================
--- gcc/gimple-fold.c   (revision 218005)
+++ gcc/gimple-fold.c   (working copy)
@@ -255,7 +255,8 @@ get_symbol_constant_value (tree sym)
         overridden at link or run time.  */
       if (!val
           && (INTEGRAL_TYPE_P (TREE_TYPE (sym))
-              || SCALAR_FLOAT_TYPE_P (TREE_TYPE (sym))))
+             || SCALAR_FLOAT_TYPE_P (TREE_TYPE (sym))
+             || POINTER_TYPE_P (TREE_TYPE (sym))))
        return build_zero_cst (TREE_TYPE (sym));
     }


it should use && is_gimple_reg_type (TREE_TYPE (sym)) in the end.

Reply via email to