From 2c9706a997918940430fa0ac0129ad2c78513f49 Mon Sep 17 00:00:00 2001 From: joerg Date: Sun, 6 Jul 2014 00:21:24 +0000 Subject: [PATCH] When building GCC with Clang, disable optimizations for tree.c until I can figure out what is responsible for the miscompilation. --- doc/TODO.clang | 5 ++++- external/gpl3/gcc/usr.bin/backend/Makefile | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/TODO.clang b/doc/TODO.clang index 766da8ae6739..ea2f8c532d7e 100644 --- a/doc/TODO.clang +++ b/doc/TODO.clang @@ -1,4 +1,4 @@ -$NetBSD: TODO.clang,v 1.11 2014/07/05 20:45:49 joerg Exp $ +$NetBSD: TODO.clang,v 1.12 2014/07/06 00:21:24 joerg Exp $ Hacks for the clang integration ------------------------------- @@ -8,3 +8,6 @@ for the incomplete explicit positioning support in LLVM MC. Workaround for .fpu handling in src/sys/lib/libunwind for ARM by forcing GNU as. + +src/external/gpl3/gcc/usr.bin/backend forces tree.c to be compiled with -O0. +g++ otherwise on trivial input. diff --git a/external/gpl3/gcc/usr.bin/backend/Makefile b/external/gpl3/gcc/usr.bin/backend/Makefile index d1bc2f40ece6..46bf3a74b852 100644 --- a/external/gpl3/gcc/usr.bin/backend/Makefile +++ b/external/gpl3/gcc/usr.bin/backend/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.21 2014/03/15 20:46:38 mrg Exp $ +# $NetBSD: Makefile,v 1.22 2014/07/06 00:21:24 joerg Exp $ LIBISPRIVATE= yes @@ -402,5 +402,7 @@ COPTS.lambda-code.c= -O0 COPTS.tree-loop-linear.c= -O0 .endif +COPTS.tree.c= ${${ACTIVE_CC} == "clang" :? -O0 :} + .PATH: ${DIST}/gcc ${DIST}/libiberty ${GCCARCH} ${G_out_file:H} ${DIST}/include .PATH: ${DIST}/gcc/config