Build with -fno-delete-null-pointer-checks
This becomes important with gcc-4.9. Without this gcc assumes
that accessing NULL pointers traps and everything that happens
behind the access is not executed. This recently happened with
i.MX53 which has:

static int imx53_silicon_revision(void)
{
	void __iomem *rom = MX53_IROM_BASE_ADDR;

	rev = readl(rom + SI_REV);
	...
}

This resulted in object code in which the last instruction is
the readl, the reset of the function is missing because gcc assumes this
is never executed.

Disable this optimization with -fno-delete-null-pointer-checks since
in barebox NULL pointers can indeed be valid.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent d46b678 commit d0c482359f89e8ea4d4c9ee558f94868f2a78ca2
@Sascha Hauer Sascha Hauer authored on 8 Jul 2015
Showing 1 changed file
View
Makefile