This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Hi, When the DECL_INITIAL is NULL for read only variables, we don't propagate the default (zero) value to the code so we still reference the symbol. This patch changes Store CPP to do this optimization for these variables. It only handles intergal and scalar float types because fold_convert does not handle many more types. OK? Bootstrapped and tested on i686-linux-gnu with no regressions. Thanks, Andrew Pinski ChangeLog: * tree-ssa-ccp.c (get_symbol_constant_value): Handle integral and scalar float variables which have a NULL DECL_INITIAL. * gcc.dg/tree-ssa/ssa-store-ccp-1.c: New test.
Attachment:
fixccp.diff.txt
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |