Pull up following revision(s) (requested by kamil in ticket #1176): external/gpl3/gcc/dist/gcc/cp/cfns.h: revision 1.2 external/gpl3/gcc/dist/gcc/cp/except.c: revision 1.2 external/gpl3/gcc/dist/gcc/cp/Make-lang.in: revision 1.6 external/gpl3/gcc/dist/gcc/cp/cfns.gperf: revision 1.2 Fix building GCC-5.3 with GCC-6.1 Cherry-pick upstream patch: From 1e5f1089dec3af328fd03125d6778f666d0bd4e4 Mon Sep 17 00:00:00 2001 From: edlinger <edlinger@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Thu, 25 Feb 2016 15:33:50 +0000 Subject: [PATCH] 2016-02-25 Bernd Edlinger <bernd.edlinger%hotmail.de@localhost> Backported from mainline 2016-02-19 Jakub Jelinek <jakub%redhat.com@localhost> Bernd Edlinger <bernd.edlinger%hotmail.de@localhost> * Make-lang.in: Invoke gperf with -L C++. * cfns.gperf: Remove prototypes for hash and libc_name_p inlines. * cfns.h: Regenerated. * except.c (nothrow_libfn_p): Adjust. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@233720 138bc75d-0d04-0410-961f-82ee72b054a4 Verified to work with GCC 5.3 and 6.1.diff -r1.4 -r1.4.4.1 src/external/gpl3/gcc/dist/gcc/cp/Make-lang.in
(snj)
--- src/external/gpl3/gcc/dist/gcc/cp/Make-lang.in 2014/04/19 12:41:31 1.4
+++ src/external/gpl3/gcc/dist/gcc/cp/Make-lang.in 2016/06/14 08:58:43 1.4.4.1
@@ -107,27 +107,27 @@ ifeq ($(ENABLE_MAINTAINER_RULES), true) | @@ -107,27 +107,27 @@ ifeq ($(ENABLE_MAINTAINER_RULES), true) | |||
107 | # Special build rule. This is a maintainer rule, that is only | 107 | # Special build rule. This is a maintainer rule, that is only | |
108 | # available when GCC is configured with --enable-maintainer-mode. In | 108 | # available when GCC is configured with --enable-maintainer-mode. In | |
109 | # other cases, it is not available to avoid triggering rebuilds if a | 109 | # other cases, it is not available to avoid triggering rebuilds if a | |
110 | # user has the source checked out with unusual timestamps. | 110 | # user has the source checked out with unusual timestamps. | |
111 | $(srcdir)/cp/cfns.h: $(srcdir)/cp/cfns.gperf | 111 | $(srcdir)/cp/cfns.h: $(srcdir)/cp/cfns.gperf | |
112 | @echo "NOT REBUILDING $@" | 112 | @echo "NOT REBUILDING $@" | |
113 | NetBSD_DISABLED_cfns.h: | 113 | NetBSD_DISABLED_cfns.h: | |
114 | else | 114 | else | |
115 | # We keep the rule so that you can still force a rebuild, even if you | 115 | # We keep the rule so that you can still force a rebuild, even if you | |
116 | # didn't configure GCC with --enable-maintainer-mode, by manually | 116 | # didn't configure GCC with --enable-maintainer-mode, by manually | |
117 | # deleting the $(srcdir)/cp/cfns.h file. | 117 | # deleting the $(srcdir)/cp/cfns.h file. | |
118 | $(srcdir)/cp/cfns.h: | 118 | $(srcdir)/cp/cfns.h: | |
119 | endif | 119 | endif | |
120 | gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \ | 120 | gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \ | |
121 | $(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h | 121 | $(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h | |
122 | 122 | |||
123 | # | 123 | # | |
124 | # Build hooks: | 124 | # Build hooks: | |
125 | 125 | |||
126 | c++.all.cross: g++-cross$(exeext) | 126 | c++.all.cross: g++-cross$(exeext) | |
127 | c++.start.encap: xg++$(exeext) | 127 | c++.start.encap: xg++$(exeext) | |
128 | c++.rest.encap: | 128 | c++.rest.encap: | |
129 | c++.info: | 129 | c++.info: | |
130 | c++.install-info: | 130 | c++.install-info: | |
131 | c++.dvi: | 131 | c++.dvi: | |
132 | c++.pdf: | 132 | c++.pdf: | |
133 | c++.install-pdf: | 133 | c++.install-pdf: |
--- src/external/gpl3/gcc/dist/gcc/cp/cfns.gperf 2014/03/01 08:43:04 1.1.1.2
+++ src/external/gpl3/gcc/dist/gcc/cp/cfns.gperf 2016/06/14 08:58:43 1.1.1.2.6.1
@@ -1,39 +1,33 @@ | @@ -1,39 +1,33 @@ | |||
1 | %language=C++ | |||
2 | %define class-name libc_name | |||
1 | %{ | 3 | %{ | |
2 | /* Copyright (C) 2000-2013 Free Software Foundation, Inc. | 4 | /* Copyright (C) 2000-2013 Free Software Foundation, Inc. | |
3 | 5 | |||
4 | This file is part of GCC. | 6 | This file is part of GCC. | |
5 | 7 | |||
6 | GCC is free software; you can redistribute it and/or modify it under | 8 | GCC is free software; you can redistribute it and/or modify it under | |
7 | the terms of the GNU General Public License as published by the Free | 9 | the terms of the GNU General Public License as published by the Free | |
8 | Software Foundation; either version 3, or (at your option) any later | 10 | Software Foundation; either version 3, or (at your option) any later | |
9 | version. | 11 | version. | |
10 | 12 | |||
11 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY | 13 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY | |
12 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | 14 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
13 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | 15 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 | for more details. | 16 | for more details. | |
15 | 17 | |||
16 | You should have received a copy of the GNU General Public License | 18 | You should have received a copy of the GNU General Public License | |
17 | along with GCC; see the file COPYING3. If not see | 19 | along with GCC; see the file COPYING3. If not see | |
18 | <http://www.gnu.org/licenses/>. */ | 20 | <http://www.gnu.org/licenses/>. */ | |
19 | #ifdef __GNUC__ | |||
20 | __inline | |||
21 | #endif | |||
22 | static unsigned int hash (const char *, unsigned int); | |||
23 | #ifdef __GNUC__ | |||
24 | __inline | |||
25 | #endif | |||
26 | const char * libc_name_p (const char *, unsigned int); | |||
27 | %} | 21 | %} | |
28 | %% | 22 | %% | |
29 | # The standard C library functions, for feeding to gperf; the result is used | 23 | # The standard C library functions, for feeding to gperf; the result is used | |
30 | # by nothrow_libfn_p. | 24 | # by nothrow_libfn_p. | |
31 | # | 25 | # | |
32 | # [lib.res.on.exception.handling]: None of the functions from the | 26 | # [lib.res.on.exception.handling]: None of the functions from the | |
33 | # Standard C library shall report an error by throwing an | 27 | # Standard C library shall report an error by throwing an | |
34 | # exception, unless it calls a program-supplied function that | 28 | # exception, unless it calls a program-supplied function that | |
35 | # throws an exception. | 29 | # throws an exception. | |
36 | # | 30 | # | |
37 | # Specific functions are commented out for the reason noted in each case. | 31 | # Specific functions are commented out for the reason noted in each case. | |
38 | # | 32 | # | |
39 | # abort -- synchronous exception from SIGABRT handler | 33 | # abort -- synchronous exception from SIGABRT handler |
--- src/external/gpl3/gcc/dist/gcc/cp/cfns.h 2014/03/01 08:43:09 1.1.1.2
+++ src/external/gpl3/gcc/dist/gcc/cp/cfns.h 2016/06/14 08:58:43 1.1.1.2.6.1
@@ -1,15 +1,15 @@ | @@ -1,15 +1,15 @@ | |||
1 | /* ANSI-C code produced by gperf version 3.0.3 */ | 1 | /* C++ code produced by gperf version 3.0.4 */ | |
2 | /* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C cfns.gperf */ | 2 | /* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L C++ --output-file cfns.h cfns.gperf */ | |
3 | 3 | |||
4 | #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ | 4 | #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ | |
5 | && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ | 5 | && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ | |
6 | && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ | 6 | && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ | |
7 | && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ | 7 | && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ | |
8 | && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ | 8 | && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ | |
9 | && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ | 9 | && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ | |
10 | && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ | 10 | && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ | |
11 | && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ | 11 | && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ | |
12 | && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ | 12 | && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ | |
13 | && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ | 13 | && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ | |
14 | && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ | 14 | && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ | |
15 | && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ | 15 | && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ | |
@@ -18,64 +18,57 @@ | @@ -18,64 +18,57 @@ | |||
18 | && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ | 18 | && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ | |
19 | && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ | 19 | && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ | |
20 | && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ | 20 | && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ | |
21 | && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ | 21 | && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ | |
22 | && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ | 22 | && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ | |
23 | && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ | 23 | && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ | |
24 | && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ | 24 | && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ | |
25 | && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ | 25 | && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ | |
26 | && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) | 26 | && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) | |
27 | /* The character set is not based on ISO-646. */ | 27 | /* The character set is not based on ISO-646. */ | |
28 | #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>." | 28 | #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>." | |
29 | #endif | 29 | #endif | |
30 | 30 | |||
31 | #line 1 "cfns.gperf" | 31 | #line 3 "cfns.gperf" | |
32 | 32 | |||
33 | /* Copyright (C) 2000-2013 Free Software Foundation, Inc. | 33 | /* Copyright (C) 2000-2013 Free Software Foundation, Inc. | |
34 | 34 | |||
35 | This file is part of GCC. | 35 | This file is part of GCC. | |
36 | 36 | |||
37 | GCC is free software; you can redistribute it and/or modify it under | 37 | GCC is free software; you can redistribute it and/or modify it under | |
38 | the terms of the GNU General Public License as published by the Free | 38 | the terms of the GNU General Public License as published by the Free | |
39 | Software Foundation; either version 3, or (at your option) any later | 39 | Software Foundation; either version 3, or (at your option) any later | |
40 | version. | 40 | version. | |
41 | 41 | |||
42 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY | 42 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY | |
43 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | 43 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
44 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | 44 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
45 | for more details. | 45 | for more details. | |
46 | 46 | |||
47 | You should have received a copy of the GNU General Public License | 47 | You should have received a copy of the GNU General Public License | |
48 | along with GCC; see the file COPYING3. If not see | 48 | along with GCC; see the file COPYING3. If not see | |
49 | <http://www.gnu.org/licenses/>. */ | 49 | <http://www.gnu.org/licenses/>. */ | |
50 | #ifdef __GNUC__ | |||
51 | __inline | |||
52 | #endif | |||
53 | static unsigned int hash (const char *, unsigned int); | |||
54 | #ifdef __GNUC__ | |||
55 | __inline | |||
56 | #endif | |||
57 | const char * libc_name_p (const char *, unsigned int); | |||
58 | /* maximum key range = 391, duplicates = 0 */ | 50 | /* maximum key range = 391, duplicates = 0 */ | |
59 | 51 | |||
60 | #ifdef __GNUC__ | 52 | class libc_name | |
61 | __inline | 53 | { | |
62 | #else | 54 | private: | |
63 | #ifdef __cplusplus | 55 | static inline unsigned int hash (const char *str, unsigned int len); | |
64 | inline | 56 | public: | |
65 | #endif | 57 | static const char *libc_name_p (const char *str, unsigned int len); | |
66 | #endif | 58 | }; | |
67 | static unsigned int | 59 | ||
68 | hash (register const char *str, register unsigned int len) | 60 | inline unsigned int | |
61 | libc_name::hash (register const char *str, register unsigned int len) | |||
69 | { | 62 | { | |
70 | static const unsigned short asso_values[] = | 63 | static const unsigned short asso_values[] = | |
71 | { | 64 | { | |
72 | 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, | 65 | 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, | |
73 | 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, | 66 | 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, | |
74 | 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, | 67 | 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, | |
75 | 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, | 68 | 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, | |
76 | 400, 400, 400, 400, 400, 400, 400, 400, 0, 0, | 69 | 400, 400, 400, 400, 400, 400, 400, 400, 0, 0, | |
77 | 1, 400, 400, 400, 400, 400, 400, 400, 400, 400, | 70 | 1, 400, 400, 400, 400, 400, 400, 400, 400, 400, | |
78 | 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, | 71 | 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, | |
79 | 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, | 72 | 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, | |
80 | 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, | 73 | 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, | |
81 | 400, 400, 400, 400, 400, 400, 400, 28, 90, 0, | 74 | 400, 400, 400, 400, 400, 400, 400, 28, 90, 0, | |
@@ -112,34 +105,28 @@ hash (register const char *str, register | @@ -112,34 +105,28 @@ hash (register const char *str, register | |||
112 | case 3: | 105 | case 3: | |
113 | hval += asso_values[(unsigned char)str[2]]; | 106 | hval += asso_values[(unsigned char)str[2]]; | |
114 | /*FALLTHROUGH*/ | 107 | /*FALLTHROUGH*/ | |
115 | case 2: | 108 | case 2: | |
116 | hval += asso_values[(unsigned char)str[1]]; | 109 | hval += asso_values[(unsigned char)str[1]]; | |
117 | /*FALLTHROUGH*/ | 110 | /*FALLTHROUGH*/ | |
118 | case 1: | 111 | case 1: | |
119 | hval += asso_values[(unsigned char)str[0]]; | 112 | hval += asso_values[(unsigned char)str[0]]; | |
120 | break; | 113 | break; | |
121 | } | 114 | } | |
122 | return hval + asso_values[(unsigned char)str[len - 1]]; | 115 | return hval + asso_values[(unsigned char)str[len - 1]]; | |
123 | } | 116 | } | |
124 | 117 | |||
125 | #ifdef __GNUC__ | |||
126 | __inline | |||
127 | #ifdef __GNUC_STDC_INLINE__ | |||
128 | __attribute__ ((__gnu_inline__)) | |||
129 | #endif | |||
130 | #endif | |||
131 | const char * | 118 | const char * | |
132 | libc_name_p (register const char *str, register unsigned int len) | 119 | libc_name::libc_name_p (register const char *str, register unsigned int len) | |
133 | { | 120 | { | |
134 | enum | 121 | enum | |
135 | { | 122 | { | |
136 | TOTAL_KEYWORDS = 156, | 123 | TOTAL_KEYWORDS = 156, | |
137 | MIN_WORD_LENGTH = 3, | 124 | MIN_WORD_LENGTH = 3, | |
138 | MAX_WORD_LENGTH = 10, | 125 | MAX_WORD_LENGTH = 10, | |
139 | MIN_HASH_VALUE = 9, | 126 | MIN_HASH_VALUE = 9, | |
140 | MAX_HASH_VALUE = 399 | 127 | MAX_HASH_VALUE = 399 | |
141 | }; | 128 | }; | |
142 | 129 | |||
143 | static const char * const wordlist[] = | 130 | static const char * const wordlist[] = | |
144 | { | 131 | { | |
145 | "wcsstr", | 132 | "wcsstr", |
--- src/external/gpl3/gcc/dist/gcc/cp/except.c 2014/03/01 08:43:05 1.1.1.2
+++ src/external/gpl3/gcc/dist/gcc/cp/except.c 2016/06/14 08:58:43 1.1.1.2.6.1
@@ -1015,27 +1015,28 @@ nothrow_libfn_p (const_tree fn) | @@ -1015,27 +1015,28 @@ nothrow_libfn_p (const_tree fn) | |||
1015 | if (TREE_PUBLIC (fn) | 1015 | if (TREE_PUBLIC (fn) | |
1016 | && DECL_EXTERNAL (fn) | 1016 | && DECL_EXTERNAL (fn) | |
1017 | && DECL_NAMESPACE_SCOPE_P (fn) | 1017 | && DECL_NAMESPACE_SCOPE_P (fn) | |
1018 | && DECL_EXTERN_C_P (fn)) | 1018 | && DECL_EXTERN_C_P (fn)) | |
1019 | /* OK */; | 1019 | /* OK */; | |
1020 | else | 1020 | else | |
1021 | /* Can't be a C library function. */ | 1021 | /* Can't be a C library function. */ | |
1022 | return 0; | 1022 | return 0; | |
1023 | 1023 | |||
1024 | /* Being a C library function, DECL_ASSEMBLER_NAME == DECL_NAME | 1024 | /* Being a C library function, DECL_ASSEMBLER_NAME == DECL_NAME | |
1025 | unless the system headers are playing rename tricks, and if | 1025 | unless the system headers are playing rename tricks, and if | |
1026 | they are, we don't want to be confused by them. */ | 1026 | they are, we don't want to be confused by them. */ | |
1027 | id = DECL_NAME (fn); | 1027 | id = DECL_NAME (fn); | |
1028 | return !!libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id)); | 1028 | return !!libc_name::libc_name_p (IDENTIFIER_POINTER (id), | |
1029 | IDENTIFIER_LENGTH (id)); | |||
1029 | } | 1030 | } | |
1030 | 1031 | |||
1031 | /* Returns nonzero if an exception of type FROM will be caught by a | 1032 | /* Returns nonzero if an exception of type FROM will be caught by a | |
1032 | handler for type TO, as per [except.handle]. */ | 1033 | handler for type TO, as per [except.handle]. */ | |
1033 | 1034 | |||
1034 | static int | 1035 | static int | |
1035 | can_convert_eh (tree to, tree from) | 1036 | can_convert_eh (tree to, tree from) | |
1036 | { | 1037 | { | |
1037 | to = non_reference (to); | 1038 | to = non_reference (to); | |
1038 | from = non_reference (from); | 1039 | from = non_reference (from); | |
1039 | 1040 | |||
1040 | if (TREE_CODE (to) == POINTER_TYPE && TREE_CODE (from) == POINTER_TYPE) | 1041 | if (TREE_CODE (to) == POINTER_TYPE && TREE_CODE (from) == POINTER_TYPE) | |
1041 | { | 1042 | { |