From 33c430b50424ec31c83603616fc94671fc7ffac2 Mon Sep 17 00:00:00 2001 From: Francois-Xavier Coudert Date: Tue, 11 Nov 2014 09:20:07 +0000 Subject: [PATCH] re PR bootstrap/63699 (Bootstrap fails in libcc1 on darwin14) PR bootstrap/63699 PR bootstrap/63750 * system.h: Include before "safe-ctype.h" * wide-int.h (wi::smin, wi::smax, wi::umin, wi::umax): Prefix calls to min/max with wi namespace. * ipa-chkp.c: Don't include . * plugin.cc: Don't include . From-SVN: r217342 --- gcc/ChangeLog | 9 +++++++++ gcc/ipa-chkp.c | 1 - gcc/system.h | 7 +++++++ gcc/wide-int.h | 8 ++++---- libcc1/ChangeLog | 6 ++++++ libcc1/plugin.cc | 2 -- 6 files changed, 26 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b19ce48fb01..f86c51baf8c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2014-11-11 Francois-Xavier Coudert + + PR bootstrap/63699 + PR bootstrap/63750 + * system.h: Include before "safe-ctype.h" + * wide-int.h (wi::smin, wi::smax, wi::umin, wi::umax): Prefix + calls to min/max with wi namespace. + * ipa-chkp.c: Don't include . + 2014-11-11 Terry Guo * doc/invoke.texi (-masm-syntax-unified): Reword and fix typo. diff --git a/gcc/ipa-chkp.c b/gcc/ipa-chkp.c index f910583907d..19a989453b6 100644 --- a/gcc/ipa-chkp.c +++ b/gcc/ipa-chkp.c @@ -41,7 +41,6 @@ along with GCC; see the file COPYING3. If not see #include "cgraph.h" #include "tree-chkp.h" #include "ipa-chkp.h" -#include /* Pointer Bounds Checker has two IPA passes to support code instrumentation. diff --git a/gcc/system.h b/gcc/system.h index 74ddfe94a59..c05f02d6273 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -194,6 +194,13 @@ extern int fprintf_unlocked (FILE *, const char *, ...); #undef fread_unlocked #undef fwrite_unlocked +/* Include before "safe-ctype.h" to avoid GCC poisoning + the ctype macros through safe-ctype.h */ + +#ifdef __cplusplus +# include +#endif + /* There are an extraordinary number of issues with . The last straw is that it varies with the locale. Use libiberty's replacement instead. */ diff --git a/gcc/wide-int.h b/gcc/wide-int.h index 2cbcbd21494..00c7d6ec0e4 100644 --- a/gcc/wide-int.h +++ b/gcc/wide-int.h @@ -2129,7 +2129,7 @@ template inline WI_BINARY_RESULT (T1, T2) wi::smin (const T1 &x, const T2 &y) { - return min (x, y, SIGNED); + return wi::min (x, y, SIGNED); } /* Return the minimum of X and Y, treating both as unsigned values. */ @@ -2137,7 +2137,7 @@ template inline WI_BINARY_RESULT (T1, T2) wi::umin (const T1 &x, const T2 &y) { - return min (x, y, UNSIGNED); + return wi::min (x, y, UNSIGNED); } /* Return the maxinum of X and Y, treating them both as having @@ -2160,7 +2160,7 @@ template inline WI_BINARY_RESULT (T1, T2) wi::smax (const T1 &x, const T2 &y) { - return max (x, y, SIGNED); + return wi::max (x, y, SIGNED); } /* Return the maximum of X and Y, treating both as unsigned values. */ @@ -2168,7 +2168,7 @@ template inline WI_BINARY_RESULT (T1, T2) wi::umax (const T1 &x, const T2 &y) { - return max (x, y, UNSIGNED); + return wi::max (x, y, UNSIGNED); } /* Return X & Y. */ diff --git a/libcc1/ChangeLog b/libcc1/ChangeLog index 431b28859d5..5624bf67964 100644 --- a/libcc1/ChangeLog +++ b/libcc1/ChangeLog @@ -1,3 +1,9 @@ +2014-11-11 Francois-Xavier Coudert + + PR bootstrap/63699 + PR bootstrap/63750 + * plugin.cc: Don't include . + 2014-10-29 Jakub Jelinek Phil Muldoon diff --git a/libcc1/plugin.cc b/libcc1/plugin.cc index 5cdd19d78ce..7b5df1d24fa 100644 --- a/libcc1/plugin.cc +++ b/libcc1/plugin.cc @@ -55,8 +55,6 @@ #include "connection.hh" #include "rpc.hh" -#include - #ifdef __GNUC__ #pragma GCC visibility push(default) #endif -- 2.30.2