aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ccp.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2009-02-18 16:01:03 -0500
committerJason Merrill <jason@gcc.gnu.org>2009-02-18 16:01:03 -0500
commit98b806924df9a7bb913cc5cc2d2e7fdc7e2a5de0 (patch)
tree0f64524f372d342649161f19523537146008f861 /gcc/tree-ssa-ccp.c
parent1e80963d6176df27cd61f268ec14392cda8a309a (diff)
downloadgcc-98b806924df9a7bb913cc5cc2d2e7fdc7e2a5de0.zip
gcc-98b806924df9a7bb913cc5cc2d2e7fdc7e2a5de0.tar.gz
gcc-98b806924df9a7bb913cc5cc2d2e7fdc7e2a5de0.tar.bz2
re PR target/39179 (Wrong code in c++ for const members initialized in external file)
PR target/39179 * tree-ssa-ccp.c (get_symbol_constant_value): Don't assume zero value if DECL_EXTERNAL. * tree-sra.c (sra_walk_gimple_assign): Likewise. * target.h (gcc_target::binds_local_p): Clarify module. * tree.h (TREE_PUBLIC): Clarify module. From-SVN: r144270
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r--gcc/tree-ssa-ccp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index ef6890c..4627265 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -287,10 +287,11 @@ get_symbol_constant_value (tree sym)
have zero as the initializer if they may not be
overridden at link or run time. */
if (!val
+ && !DECL_EXTERNAL (sym)
&& targetm.binds_local_p (sym)
&& (INTEGRAL_TYPE_P (TREE_TYPE (sym))
|| SCALAR_FLOAT_TYPE_P (TREE_TYPE (sym))))
- return fold_convert (TREE_TYPE (sym), integer_zero_node);
+ return fold_convert (TREE_TYPE (sym), integer_zero_node);
}
return NULL_TREE;