Thread (15 messages) flat view 15 messages, 8 authors, 2017-03-08

RE: [PATCH] powerpc: Avoid panic during boot due to divide by zero in init_cache_info()

From: David Laight <hidden>
Date: 2017-03-06 15:18:48

From: Segher Boessenkool
Sent: 06 March 2017 14:18
On Mon, Mar 06, 2017 at 01:03:19PM +0100, Gabriel Paubert wrote:
quoted
quoted
quoted
quoted
The PowerPC divw etc. instructions do not trap by themselves, but=
 recent
quoted
quoted
quoted
quoted
GCC inserts trap instructions on code paths that are always undef=
ined
quoted
quoted
quoted
quoted
behaviour (like, dividing by zero).
Is it systematic or does it depend from, e.g., optimization levels?
In this case it needs -fisolate-erroneous-paths-dereference which is
default at -O2 and higher.
Great, another optimization-dependent behaviour. :-(
=20
It makes the "behaviour" for undefined behaviour *less* surprising.
It does not change anything else: malformed programs stay malformed,
correct programs do exactly what they did before, too.
Yep, 'undefined behaviour' is exactly that.
It doesn't mean 'undefined result', or 'maybe a signal'.
Wiping the disk and targeting the user with an ICBM are both valid.

	David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help