Hi Jason,
On 08/10/15 03:42, Jason Merrill wrote:
While looking at another issue I noticed that in g++.dg/init/vbase1.C
the Diamond(int) constructor was unnecessarily storing a CONSTRUCTOR
into a stack temporary and then copying it into the SubB base
subobject rather than directly storing the CONSTRUCTOR. It was doing
this because the base subobject is smaller than a complete object of
SubB, but we already know how to store a CONSTRUCTOR into a space
smaller than it would normally take without needing to introduce an
extra temporary. This patch fixes that.
Tested x86_64-pc-linux-gnu. OK for trunk?
The new test added to g++.dg/init/vbase1.C fails on arm target.
It assumes that, the target provides a pattern to store 0 into memory at
least during expand stage. This is fine on aarch64, mips as they
provided a zero register to do that.
But for targets which only allows register store and doesn't have zero
register. This check is inapplicable. During the expand stage, the
immediate might be forced into register. This what happens on arm,
rs6000 target AFAIK.
Regards,
Renlin