diff options
author | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-01-20 21:08:26 +0000 |
---|---|---|
committer | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-01-20 21:08:26 +0000 |
commit | 4f13e57574b3286c696895c0455688344e04195b (patch) | |
tree | 50ccb405fa1d7c6f984e4ac16406a0427cd1910a /gcc/cgraph.c | |
parent | f5d830da067d0a81f716e71bb0d377e6406445a4 (diff) | |
download | gcc-4f13e57574b3286c696895c0455688344e04195b.tar.gz |
Add type to DEFCIFCODE to describe the inline failure
Report inline error during early inlining if the inline failure is
CIF_FINAL_ERROR.
gcc/
PR middle-end/59789
* cgraph.c (cgraph_inline_failed_string): Add type to DEFCIFCODE.
(cgraph_inline_failed_type): New function.
* cgraph.h (DEFCIFCODE): Add type.
(cgraph_inline_failed_type_t): New enum.
(cgraph_inline_failed_type): New prototype.
* cif-code.def: Add CIF_FINAL_NORMAL to OK, FUNCTION_NOT_CONSIDERED,
FUNCTION_NOT_OPTIMIZED, REDEFINED_EXTERN_INLINE,
FUNCTION_NOT_INLINE_CANDIDATE, LARGE_FUNCTION_GROWTH_LIMIT,
LARGE_STACK_FRAME_GROWTH_LIMIT, MAX_INLINE_INSNS_SINGLE_LIMIT,
MAX_INLINE_INSNS_AUTO_LIMIT, INLINE_UNIT_GROWTH_LIMIT,
RECURSIVE_INLINING, UNLIKELY_CALL, NOT_DECLARED_INLINED,
OPTIMIZING_FOR_SIZE, ORIGINALLY_INDIRECT_CALL,
INDIRECT_UNKNOWN_CALL, USES_COMDAT_LOCAL.
Add CIF_FINAL_ERROR to UNSPECIFIED, BODY_NOT_AVAILABLE,
FUNCTION_NOT_INLINABLE, OVERWRITABLE, MISMATCHED_ARGUMENTS,
EH_PERSONALITY, NON_CALL_EXCEPTIONS, TARGET_OPTION_MISMATCH,
OPTIMIZATION_MISMATCH.
* tree-inline.c (expand_call_inline): Emit errors during
early_inlining if cgraph_inline_failed_type returns
CIF_FINAL_ERROR.
gcc/testsuite/
PR middle-end/59789
* gcc.target/i386/pr59789.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206858 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r-- | gcc/cgraph.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 92b31b92252..ae1f43c4359 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -1877,7 +1877,7 @@ const char* cgraph_inline_failed_string (cgraph_inline_failed_t reason) { #undef DEFCIFCODE -#define DEFCIFCODE(code, string) string, +#define DEFCIFCODE(code, type, string) string, static const char *cif_string_table[CIF_N_REASONS] = { #include "cif-code.def" @@ -1889,6 +1889,24 @@ cgraph_inline_failed_string (cgraph_inline_failed_t reason) return cif_string_table[reason]; } +/* Return a type describing the failure REASON. */ + +cgraph_inline_failed_type_t +cgraph_inline_failed_type (cgraph_inline_failed_t reason) +{ +#undef DEFCIFCODE +#define DEFCIFCODE(code, type, string) type, + + static cgraph_inline_failed_type_t cif_type_table[CIF_N_REASONS] = { +#include "cif-code.def" + }; + + /* Signedness of an enum type is implementation defined, so cast it + to unsigned before testing. */ + gcc_assert ((unsigned) reason < CIF_N_REASONS); + return cif_type_table[reason]; +} + /* Names used to print out the availability enum. */ const char * const cgraph_availability_names[] = {"unset", "not_available", "overwritable", "available", "local"}; |