Re: Confusion with labels as values

2019-06-20 Thread Segher Boessenkool
On Wed, Jun 19, 2019 at 11:37:52AM -0600, Jeff Law wrote: > On 6/19/19 11:09 AM, Segher Boessenkool wrote: > > On Wed, Jun 19, 2019 at 09:39:01AM -0600, Jeff Law wrote: > >> A label used as a value, but which is not a jump target will have an > >> indeterminate value -- it'll end up somewhere in it

Re: Confusion with labels as values

2019-06-19 Thread Jeff Law
On 6/19/19 11:09 AM, Segher Boessenkool wrote: > On Wed, Jun 19, 2019 at 09:39:01AM -0600, Jeff Law wrote: >> A label used as a value, but which is not a jump target will have an >> indeterminate value -- it'll end up somewhere in its containing >> function, that's all we guarantee in that case. >

Re: Confusion with labels as values

2019-06-19 Thread Segher Boessenkool
On Wed, Jun 19, 2019 at 09:39:01AM -0600, Jeff Law wrote: > A label used as a value, but which is not a jump target will have an > indeterminate value -- it'll end up somewhere in its containing > function, that's all we guarantee in that case. In gimple it was fine and expected, and expand *did*

Re: Confusion with labels as values

2019-06-19 Thread Jeff Law
On 6/19/19 7:04 AM, Florian Rommel wrote: > Hi, > > Recently I wanted to take and print the address of a label. When > compiling with -O2, I noticed that the address equals the function body > start address if the label is not used as a goto target. > > Here is an example: > > #include > int m

Confusion with labels as values

2019-06-19 Thread Florian Rommel
Hi, Recently I wanted to take and print the address of a label. When compiling with -O2, I noticed that the address equals the function body start address if the label is not used as a goto target. Here is an example: #include int main(void) { printf("main: %p\n", main); printf("labe