Re: [PATCH] tell gcc optimizer to never introduce new data races

From: Jiri Kosina
Date: Wed Aug 20 2014 - 19:28:09 EST


On Tue, 10 Jun 2014, Jiri Kosina wrote:

> We have been chasing a memory corruption bug, which turned out to be
> caused by very old gcc (4.3.4), which happily turned conditional load into
> a non-conditional one, and that broke correctness (the condition was met
> only if lock was held) and corrupted memory.
>
> This particular problem with that particular code did not happen when
> never gccs were used. I've brought this up with our gcc folks, as I wanted
> to make sure that this can't really happen again, and it turns out it
> actually can.

For the record (and for mailinglist archives to catch this information) --
the default has been changed for gcc 4.10 to a sane value (0).

I'd however suggest we keep changes made by commit 69102311a ("./Makefile:
tell gcc optimizer to never introduce new data races") for rather a long
time.

--
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/