On Mon, Jan 6, 2020 at 12:03 PM Jonathan Wakely wrote:
>
> On Fri, 3 Jan 2020 at 16:09, Erick Ochoa wrote:
> > Do you mean something like taking the address of a struct and adding an
> > offset
> > to access a field?
>
> Yes, the following code is valid:
>
> struct S { int unused; int used; };
>
On Fri, 3 Jan 2020 at 16:09, Erick Ochoa wrote:
> Do you mean something like taking the address of a struct and adding an offset
> to access a field?
Yes, the following code is valid:
struct S { int unused; int used; };
static_assert( sizeof(S) == 8 );
S s[4];
int* s2_used = (int*)((char*)s + 20)
On 2019-12-24 2:37 a.m., Richard Biener wrote:
> On December 23, 2019 6:30:31 PM GMT+01:00, Erick Ochoa
> wrote:
>> Hi,
>>
>> I am working on an LTO pass which drops unused fields on structs. On my
>> tests, I found that the gimple generated for `sizeof` is a constant.
>> For
>> example, for t
On 12/23/19 12:30 PM, Erick Ochoa wrote:
Hi,
I am working on an LTO pass which drops unused fields on structs. On my
tests, I found that the gimple generated for `sizeof` is a constant. For
example, for the following C code:
```
you also need to pay attention to offsetof.
nathan
--
Nathan Si
On December 23, 2019 6:30:31 PM GMT+01:00, Erick Ochoa
wrote:
>Hi,
>
>I am working on an LTO pass which drops unused fields on structs. On my
>tests, I found that the gimple generated for `sizeof` is a constant.
>For
>example, for the following C code:
>
>```
>struct astruct_s { _Bool c; _Bool a;