Re: const volatile behaviour change in GCC 7

2016-09-22 Thread David Brown
On 22/09/16 17:30, Richard Biener wrote: On September 22, 2016 5:20:56 PM GMT+02:00, paul.kon...@dell.com wrote: On Sep 22, 2016, at 11:16 AM, David Brown wrote: On 22/09/16 16:57, paul.kon...@dell.com wrote: On Sep 22, 2016, at 6:17 AM, David Brown wrote: ... Your trouble is that y

Re: const volatile behaviour change in GCC 7

2016-09-22 Thread Sergey Organov
Sebastian Huber writes: > On 22/09/16 14:11, Sergey Organov wrote: >> Sebastian Huber writes: >>> Hello, [...] >> Alternatively, try (untested, and I removed attributes to make my point >> clearer): >> >> /* Linker-defined symbols */ >> >> rtems_sysinit_item const _Linker_set__Sysinit_begin[0]

Re: const volatile behaviour change in GCC 7

2016-09-22 Thread Paul.Koning
> On Sep 22, 2016, at 11:31 AM, Richard Earnshaw (lists) > wrote: > >>> ... >>> void rtems_initialize_executive(void) >>> { >>> uintptr_t cur = (uintptr_t) _Linker_set__Sysinit_begin; >>> uintptr_t end = (uintptr_t) _Linker_set__Sysinit_end; >> >> I would not expect the compiler to apply point

Re: const volatile behaviour change in GCC 7

2016-09-22 Thread Richard Earnshaw (lists)
On 22/09/16 16:20, paul.kon...@dell.com wrote: > >> On Sep 22, 2016, at 11:16 AM, David Brown wrote: >> >> On 22/09/16 16:57, paul.kon...@dell.com wrote: >>> On Sep 22, 2016, at 6:17 AM, David Brown wrote: ... Your trouble is that your two pointers, cur and end, are pointing

Re: const volatile behaviour change in GCC 7

2016-09-22 Thread Richard Biener
On September 22, 2016 5:20:56 PM GMT+02:00, paul.kon...@dell.com wrote: > >> On Sep 22, 2016, at 11:16 AM, David Brown >wrote: >> >> On 22/09/16 16:57, paul.kon...@dell.com wrote: >>> On Sep 22, 2016, at 6:17 AM, David Brown >wrote: ... Your trouble is that your two pointer

Re: const volatile behaviour change in GCC 7

2016-09-22 Thread Paul.Koning
> On Sep 22, 2016, at 11:16 AM, David Brown wrote: > > On 22/09/16 16:57, paul.kon...@dell.com wrote: >> >>> On Sep 22, 2016, at 6:17 AM, David Brown wrote: >>> >>> ... >>> Your trouble is that your two pointers, cur and end, are pointing at >>> different variables. Comparing two pointers th

Re: const volatile behaviour change in GCC 7

2016-09-22 Thread David Brown
On 22/09/16 16:57, paul.kon...@dell.com wrote: > >> On Sep 22, 2016, at 6:17 AM, David Brown wrote: >> >> ... >> Your trouble is that your two pointers, cur and end, are pointing at >> different variables. Comparing two pointers that are independent (i.e., >> not pointing to parts of the same ag

Re: const volatile behaviour change in GCC 7

2016-09-22 Thread Paul.Koning
> On Sep 22, 2016, at 6:17 AM, David Brown wrote: > > ... > Your trouble is that your two pointers, cur and end, are pointing at > different variables. Comparing two pointers that are independent (i.e., > not pointing to parts of the same aggregate object) is undefined - the > compiler can assu

Re: const volatile behaviour change in GCC 7

2016-09-22 Thread Sebastian Huber
On 22/09/16 14:11, Sergey Organov wrote: Sebastian Huber writes: Hello, for RTEMS we use linker sets to initialize the system. The following code worked up to GCC 6, but no longer in GCC 7: typedef void ( *rtems_sysinit_handler )( void ); typedef struct { rtems_sysinit_handler handler;

Re: const volatile behaviour change in GCC 7

2016-09-22 Thread Sergey Organov
Sebastian Huber writes: > Hello, > > for RTEMS we use linker sets to initialize the system. The following > code worked up to GCC 6, but no longer in GCC 7: > > typedef void ( *rtems_sysinit_handler )( void ); > > typedef struct { > rtems_sysinit_handler handler; > } rtems_sysinit_item; > > rte

Re: const volatile behaviour change in GCC 7

2016-09-22 Thread David Brown
On 22/09/16 09:23, Sebastian Huber wrote: > Hello, > > for RTEMS we use linker sets to initialize the system. The following > code worked up to GCC 6, but no longer in GCC 7: > > typedef void ( *rtems_sysinit_handler )( void ); > > typedef struct { > rtems_sysinit_handler handler; > } rtems_sy

Re: const volatile behaviour change in GCC 7

2016-09-22 Thread Richard Biener
On Thu, Sep 22, 2016 at 9:58 AM, Andreas Schwab wrote: > On Sep 22 2016, Sebastian Huber wrote: > >> for RTEMS we use linker sets to initialize the system. The following code >> worked up to GCC 6, but no longer in GCC 7: >> >> typedef void ( *rtems_sysinit_handler )( void ); >> >> typedef struct

Re: const volatile behaviour change in GCC 7

2016-09-22 Thread Andreas Schwab
On Sep 22 2016, Sebastian Huber wrote: > for RTEMS we use linker sets to initialize the system. The following code > worked up to GCC 6, but no longer in GCC 7: > > typedef void ( *rtems_sysinit_handler )( void ); > > typedef struct { > rtems_sysinit_handler handler; > } rtems_sysinit_item; > >

Re: const volatile behaviour change in GCC 7

2016-09-22 Thread Andrew Pinski
On Thu, Sep 22, 2016 at 3:23 PM, Sebastian Huber wrote: > Hello, > > for RTEMS we use linker sets to initialize the system. The following code > worked up to GCC 6, but no longer in GCC 7: > > typedef void ( *rtems_sysinit_handler )( void ); > > typedef struct { > rtems_sysinit_handler handler;