Commit 359b8672 by Andrew Haley Committed by Andrew Haley

re PR c++/39380 (All programs that link Java and C++ libraries fail when optimized)

2009-03-26  Andrew Haley  <aph@redhat.com>

        PR C++/39380
        * decl2.c (possibly_inlined_p): If java exceptions are in use
        don't inline a decl unless it is explicitly marked inline.
        * lex.c: (pragma_java_exceptions): New variable.
        (handle_pragma_java_exceptions): Set pragma_java_exceptions.
        * cp-tree.h (pragma_java_exceptions): Declare new variable.

From-SVN: r145091
parent 61238a79
2009-03-26 Andrew Haley <aph@redhat.com>
PR C++/39380
* decl2.c (possibly_inlined_p): If java exceptions are in use
don't inline a decl unless it is explicitly marked inline.
* lex.c: (pragma_java_exceptions): New variable.
(handle_pragma_java_exceptions): Set pragma_java_exceptions.
* cp-tree.h (pragma_java_exceptions): Declare new variable.
2009-03-24 Jason Merrill <jason@redhat.com>
PR c++/28274
......
......@@ -4171,6 +4171,9 @@ struct tinst_level GTY(())
e.g "int f(void)". */
extern cp_parameter_declarator *no_parameters;
/* True if we saw "#pragma GCC java_exceptions". */
extern bool pragma_java_exceptions;
/* in call.c */
extern bool check_dtor_name (tree, tree);
......
......@@ -3772,7 +3772,7 @@ possibly_inlined_p (tree decl)
gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
if (DECL_UNINLINABLE (decl))
return false;
if (!optimize)
if (!optimize || pragma_java_exceptions)
return DECL_DECLARED_INLINE_P (decl);
/* When optimizing, we might inline everything when flatten
attribute or heuristics inlining for size or autoinlining
......
......@@ -81,6 +81,8 @@ struct impl_files
static struct impl_files *impl_file_chain;
/* True if we saw "#pragma GCC java_exceptions". */
bool pragma_java_exceptions;
void
cxx_finish (void)
......@@ -430,6 +432,7 @@ handle_pragma_java_exceptions (cpp_reader* dfile ATTRIBUTE_UNUSED)
warning (0, "junk at end of #pragma GCC java_exceptions");
choose_personality_routine (lang_java);
pragma_java_exceptions = true;
}
/* Issue an error message indicating that the lookup of NAME (an
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment