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]

Re: [PATCH] Fix PR c++/42556


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]