Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1504049
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 01/12] extarray: define helpers for arrays defined in linker scripts |
| Date | 2016-10-19 18:20 +0200 |
| Message-ID | <su02u-2rf-69@gated-at.bofh.it> (permalink) |
| References | (5 earlier) <stehb-2NB-1@gated-at.bofh.it> <steAx-2Ua-9@gated-at.bofh.it> <stxDc-7sX-15@gated-at.bofh.it> <stJXI-7yE-15@gated-at.bofh.it> <su02u-2rf-67@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, Oct 19, 2016 at 10:18:43AM +0200, Richard Biener wrote:
> The commit implements a long-standing failure to optimize trivial pointer
> comparisons that arise for example from libstdc++. PR65686 contains
> a simple C example:
>
> mytype f(struct S *e)
> {
> mytype x;
> if(&x != e->pu)
> __builtin_memcpy(&x, e->pu, sizeof(unsigned));
> return x;
> }
>
> where GCC before the commit could not optimize the &x != e->pu test
> as trivial false.
Which is fine; x is stack based and could not possibly have been handed
as the argument to this same function.
This is also an entirely different class of optimizations than the whole
pointer arithmetic is only valid inside an object thing.
The kernel very much relies on unbounded pointer arithmetic, including
overflow. Sure, C language says its UB, but we know our memory layout,
and it would be very helpful if we could define it.
Can't we get a knob extending -fno-strict-aliasing to define pointer
arithmetic outside of objects and overflow? I mean, we already use that,
we also use -fno-strict-overflow and a whole bunch of others.
At the very least, it would be nice to get a -W flag for when this alias
analysis stuff kills something so we can at least know when GCC goes and
defeats us.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/12] external array access helpers Vegard Nossum <vegard.nossum@oracle.com> - 2016-10-16 17:30 +0200
[PATCH 07/12] tracing: declare __{start,stop}_ftrace_enum_maps as external array Vegard Nossum <vegard.nossum@oracle.com> - 2016-10-16 17:30 +0200
[PATCH 01/12] extarray: define helpers for arrays defined in linker scripts Vegard Nossum <vegard.nossum@oracle.com> - 2016-10-16 17:30 +0200
Re: [PATCH 01/12] extarray: define helpers for arrays defined in linker scripts Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-17 09:10 +0200
Re: [PATCH 01/12] extarray: define helpers for arrays defined in linker scripts Peter Zijlstra <peterz@infradead.org> - 2016-10-17 10:40 +0200
Re: [PATCH 01/12] extarray: define helpers for arrays defined in linker scripts Jiri Slaby <jslaby@suse.cz> - 2016-10-17 11:10 +0200
Re: [PATCH 01/12] extarray: define helpers for arrays defined in linker scripts Peter Zijlstra <peterz@infradead.org> - 2016-10-17 11:10 +0200
Re: [PATCH 01/12] extarray: define helpers for arrays defined in linker scripts Vegard Nossum <vegard.nossum@oracle.com> - 2016-10-17 13:30 +0200
Re: [PATCH 01/12] extarray: define helpers for arrays defined in linker scripts Peter Zijlstra <peterz@infradead.org> - 2016-10-17 13:50 +0200
Re: [PATCH 01/12] extarray: define helpers for arrays defined in linker scripts Vegard Nossum <vegard.nossum@oracle.com> - 2016-10-18 10:10 +0200
Re: [PATCH 01/12] extarray: define helpers for arrays defined in linker scripts "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-10-18 23:20 +0200
Re: [PATCH 01/12] extarray: define helpers for arrays defined in linker scripts Richard Biener <rguenther@suse.de> - 2016-10-19 16:30 +0200
Re: [PATCH 01/12] extarray: define helpers for arrays defined in linker scripts Peter Zijlstra <peterz@infradead.org> - 2016-10-19 16:40 +0200
Re: [PATCH 01/12] extarray: define helpers for arrays defined in linker scripts Richard Biener <rguenther@suse.de> - 2016-10-19 18:00 +0200
Re: [PATCH 01/12] extarray: define helpers for arrays defined in linker scripts Peter Zijlstra <peterz@infradead.org> - 2016-10-19 18:10 +0200
Re: [PATCH 01/12] extarray: define helpers for arrays defined in linker scripts Richard Biener <rguenther@suse.de> - 2016-10-19 17:10 +0200
Re: [PATCH 01/12] extarray: define helpers for arrays defined in linker scripts Peter Zijlstra <peterz@infradead.org> - 2016-10-19 18:20 +0200
Re: [PATCH 01/12] extarray: define helpers for arrays defined in linker scripts Jiri Slaby <jslaby@suse.cz> - 2016-10-19 16:50 +0200
[PATCH 12/12] dynamic debug: declare table as external array Vegard Nossum <vegard.nossum@oracle.com> - 2016-10-16 17:30 +0200
[PATCH 10/12] serial_core: declare __earlycon_table{,_end} as external array Vegard Nossum <vegard.nossum@oracle.com> - 2016-10-16 18:00 +0200
[PATCH 08/12] tracing: declare __trace_bprintk_fmt/__tracepoint_str as external arrays Vegard Nossum <vegard.nossum@oracle.com> - 2016-10-16 18:00 +0200
[PATCH 09/12] tracing: declare __{start,stop}_syscalls_metadata as external array Vegard Nossum <vegard.nossum@oracle.com> - 2016-10-16 18:20 +0200
Re: [PATCH 00/12] external array access helpers Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-16 18:20 +0200
Re: [PATCH 00/12] external array access helpers Vegard Nossum <vegard.nossum@oracle.com> - 2016-10-16 19:30 +0200
Re: [PATCH 00/12] external array access helpers Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-17 09:10 +0200
Re: [PATCH 00/12] external array access helpers Jiri Slaby <jslaby@suse.cz> - 2016-10-17 08:30 +0200
csiph-web