[PATCH] Fix PR c++/42556
Jie Zhang
jie@codesourcery.com
Tue Mar 23 10:27:00 GMT 2010
On 03/23/2010 05:16 PM, Jakub Jelinek wrote:
> 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.
>
Yes. You are right. But DSE is not able to handle this for ARM. If we do
this as early as gimplify, it will be beneficial to all targets.
--
Jie Zhang
CodeSourcery
(650) 331-3385 x735
More information about the Gcc-patches
mailing list