This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/35494] [4.4 Regression]: Revision 132991 breaks 483.xalancbmk
- From: "hjl dot tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Mar 2008 14:24:29 -0000
- Subject: [Bug tree-optimization/35494] [4.4 Regression]: Revision 132991 breaks 483.xalancbmk
- References: <bug-35494-682@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from hjl dot tools at gmail dot com 2008-03-07 14:24 -------
This patch
--- tree-ssa-ccp.c.local 2008-03-06 14:18:27.000000000 -0800
+++ tree-ssa-ccp.c 2008-03-07 06:21:57.000000000 -0800
@@ -306,9 +306,10 @@ get_symbol_constant_value (tree sym)
if (val
&& ccp_decl_initial_min_invariant (val))
return val;
- /* Variables declared 'const' without an initializer
+ /* Local variables declared 'const' without an initializer
have zero as the intializer. */
if (!val
+ && !TREE_PUBLIC (sym)
&& (INTEGRAL_TYPE_P (TREE_TYPE (sym))
|| SCALAR_FLOAT_TYPE_P (TREE_TYPE (sym))))
return fold_convert (TREE_TYPE (sym), integer_zero_node);
works on small C++ testcase. I will try 483.xalancbmk next.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35494