diff mbox

Fix overly restrictive condition in get_symbol_constant_value

Message ID alpine.LSU.2.11.1411261106390.374@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Biener Nov. 26, 2014, 10:07 a.m. UTC
The following fixes an overly restrictive condition on the zeros we
produce when folding a read from a zero-initialized global.  Now it
matches what we allow elsewhere and what is useful.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2014-11-26  Richard Biener  <rguenther@suse.de>

	* gimple-fold.c (get_symbol_constant_value): Allow all
	GIMPLE register type zero-constants.
diff mbox

Patch

Index: gcc/gimple-fold.c
===================================================================
--- gcc/gimple-fold.c	(revision 218073)
+++ gcc/gimple-fold.c	(working copy)
@@ -254,8 +254,7 @@  get_symbol_constant_value (tree sym)
 	 have zero as the initializer if they may not be
 	 overridden at link or run time.  */
       if (!val
-          && (INTEGRAL_TYPE_P (TREE_TYPE (sym))
-	       || SCALAR_FLOAT_TYPE_P (TREE_TYPE (sym))))
+          && is_gimple_reg_type (TREE_TYPE (sym)))
 	return build_zero_cst (TREE_TYPE (sym));
     }