Re: RFC noipa sizeof function for record relayout at link time

2020-06-29 Thread Joseph Myers
On Mon, 29 Jun 2020, Erick Ochoa wrote: > We are not targeting C++ at the moment. What contexts exist in C where we > require constant expressions? On the top of my head I have array sizes and > initialization of static variables? In such cases, then yes we agree that we Bit-field widths, static

Re: RFC noipa sizeof function for record relayout at link time

2020-06-29 Thread Martin Jambor
Hi, On Mon, Jun 29 2020, Erick Ochoa wrote: > On 29.06.20 06:05, Martin Jambor wrote: >> Hi, >> >> On Mon, Jun 29 2020, Erick Ochoa wrote: >>> == How do we get what we want? == >>> >>> Ideally what we want is to: >>> >> >> [...] >> >>> * Disable constant propagation and other optimizations: >>>

Re: RFC noipa sizeof function for record relayout at link time

2020-06-29 Thread Erick Ochoa
On 29.06.20 06:05, Martin Jambor wrote: Hi, On Mon, Jun 29 2020, Erick Ochoa wrote: == How do we get what we want? == Ideally what we want is to: [...] * Disable constant propagation and other optimizations: * possibly __attribute__((noipa)) [...] == What's the WORST CASE perfo

Re: RFC noipa sizeof function for record relayout at link time

2020-06-29 Thread Martin Jambor
Hi, On Mon, Jun 29 2020, Erick Ochoa wrote: > == How do we get what we want? == > > Ideally what we want is to: > [...] > * Disable constant propagation and other optimizations: >* possibly __attribute__((noipa)) [...] > == What's the WORST CASE performance of having an unknown sizeof? ==

Re: RFC noipa sizeof function for record relayout at link time

2020-06-29 Thread Erick Ochoa
On 29.06.20 04:08, Richard Biener wrote: On Mon, Jun 29, 2020 at 1:05 PM Richard Biener wrote: On Mon, Jun 29, 2020 at 11:56 AM Erick Ochoa wrote: Hello, I have been working on link time optimization for C that may change the size of structs (at link time). We are close to sharing the r

Re: RFC noipa sizeof function for record relayout at link time

2020-06-29 Thread Erick Ochoa
On 29.06.20 04:05, Richard Biener wrote: On Mon, Jun 29, 2020 at 11:56 AM Erick Ochoa wrote: Hello, I have been working on link time optimization for C that may change the size of structs (at link time). We are close to sharing the results we have so far, but there are a couple of missing

Re: RFC noipa sizeof function for record relayout at link time

2020-06-29 Thread Jakub Jelinek via Gcc
On Mon, Jun 29, 2020 at 01:05:20PM +0200, Richard Biener via Gcc wrote: > > // source code > > struct astruct a; > > memset(a, 0, sizeof(a)); > > > > // parse time > > memset(a, 0, 64); Actually, I don't see the point at all, it doesn't matter if the user used sizeof(a) or 64 knowing that the stru

Re: RFC noipa sizeof function for record relayout at link time

2020-06-29 Thread Richard Biener via Gcc
On Mon, Jun 29, 2020 at 1:05 PM Richard Biener wrote: > > On Mon, Jun 29, 2020 at 11:56 AM Erick Ochoa > wrote: > > > > Hello, > > > > I have been working on link time optimization for C that may change the > > size of structs (at link time). We are close to sharing the results we > > have so far

Re: RFC noipa sizeof function for record relayout at link time

2020-06-29 Thread Richard Biener via Gcc
On Mon, Jun 29, 2020 at 11:56 AM Erick Ochoa wrote: > > Hello, > > I have been working on link time optimization for C that may change the > size of structs (at link time). We are close to sharing the results we > have so far, but there are a couple of missing pieces left to work on: > > Implement

RFC noipa sizeof function for record relayout at link time

2020-06-29 Thread Erick Ochoa
Hello, I have been working on link time optimization for C that may change the size of structs (at link time). We are close to sharing the results we have so far, but there are a couple of missing pieces left to work on: Implementations of sizeof and offsetof that support this change in stru