[PATCH] Fix PR c++/42556
Jakub Jelinek
jakub@redhat.com
Tue Mar 23 09:52:00 GMT 2010
On Tue, Mar 23, 2010 at 04:47:26PM +0800, Jie Zhang wrote:
> The cause of this PR is that the C++ front end splits the
> nonconstant part initialization of
>
> int v[4] = {a, b, c, d};
>
> into separate statements. In this test case, all the elements in the
> initializers are noncontant. After nonconstant splitting, an empty
> CONSTRUCTOR tree is left. The C++ front end does not remove it
> although it can. But in GCC an empty CONSTRUCTOR means zero out the
> whole structure. And the later passes of GCC failed to remove the
> useless zeroing.
That's weird, at least RTL DSE should be able handle that.
It should be able to nuke even memset call.
E.g. on x86_64-linux DSE1 removes the clearing of the 4 elements.
Jakub
More information about the Gcc-patches
mailing list