On 10/28/2015 07:06 PM, Alexander Monakov wrote:
On Wed, 28 Oct 2015, Bernd Schmidt wrote:
Ok, so adjust the if condition for non-integral types - make it false if the
size of the struct is smaller than the pointer type.
I'm afraid it's an insufficient fix: it would remain broken for size-12
structs (containing 3 int fields, for example): they would be emitted with
size 16 instead.
Maybe check TYPE_ or DECL_ALIGN as well then. But I think in general the
problem cannot be avoided, let's say if you have a size-12 struct with a
pointer field.
(and as far as I see I can't make the condition false anyway, we still need
to pick some PTX type when emitting a struct)
Well I thought you could rely on the int_size_in_bytes thing, but the
size-12 struct is a counterexample.
Bernd