[PATCH] Improve Store CCP for NULL DECL_INITIAL (PR 35402)
Andrew_Pinski@PlayStation.Sony.Com
Andrew_Pinski@PlayStation.Sony.Com
Thu Mar 6 21:48:00 GMT 2008
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.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fixccp.diff.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080306/2c1fe1db/attachment.txt>
More information about the Gcc-patches
mailing list