From mboxrd@z Thu Jan 1 00:00:00 1970 From: York Sun Date: Wed, 20 May 2015 10:10:47 -0700 Subject: [U-Boot] [PATCH] powerpc/mpc85xx:Add GCC flag -fno-delete-null-pointer-checks In-Reply-To: <1430978853-10337-1-git-send-email-prabhakar@freescale.com> References: <1430978853-10337-1-git-send-email-prabhakar@freescale.com> Message-ID: <555CC017.5040507@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Scott, Please comment on this patch. York On 05/06/2015 11:07 PM, Prabhakar Kushwaha wrote: > -fdelete-null-pointer-checks flag controls global dataflow analyses and > eliminate useless checks for null pointers; It assume that if a pointer is > checked after it has already been dereferenced, it cannot be null. > This flag is enabled by default. > > gcc v4.9 has more optimizations added to this option. Hence it is very > aggressive with GCC v4.9 series. Add -fno-delete-null-pointer-checks to > disable the optimization > > Signed-off-by: Rohit Dharmakan > Signed-off-by: Prabhakar Kushwaha > --- > arch/powerpc/cpu/mpc85xx/config.mk | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/powerpc/cpu/mpc85xx/config.mk b/arch/powerpc/cpu/mpc85xx/config.mk > index 72c964c..2aedd24 100644 > --- a/arch/powerpc/cpu/mpc85xx/config.mk > +++ b/arch/powerpc/cpu/mpc85xx/config.mk > @@ -5,7 +5,8 @@ > # SPDX-License-Identifier: GPL-2.0+ > # > > -PLATFORM_CPPFLAGS += -Wa,-me500 -msoft-float -mno-string > +PLATFORM_CPPFLAGS += -Wa,-me500 -msoft-float -mno-string \ > + -fno-delete-null-pointer-checks > > # -mspe=yes is needed to have -mno-spe accepted by a buggy GCC; > # see "[PATCH,rs6000] make -mno-spe work as expected" on >