This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[java] RFA: builtins vs. -findirect-dispatch
- From: Bryce McKinlay <mckinlay at redhat dot com>
- To: Java Patches <java-patches at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 13 Jul 2006 00:27:07 -0400
- Subject: [java] RFA: builtins vs. -findirect-dispatch
Currently, some of GCJ's Math builtins can generate non-indirect
function calls even when -findirect-dispatch is set. The simplest fix
for this seems to be to simply disable builtins where a function call
could be generated and -findirect-dispatch in use. This shouldn't really
effect performance for the general case, since these builtins usually
seem to generate function calls anyway unless -ffast-math is in use.
Other builtins like Math.min(), which never use a function call, will
still work.
This is needed for the upcoming libgcj_bc patch, since that will ensure
at link time that only known BC-ABI symbols are used by an
-findirect-dispatch binary.
OK to commit?
Bryce
2006-07-12 Bryce McKinlay <mckinlay@redhat.com>
* builtins.c (check_for_builtin): If a builtin could result in a
direct call being generated, don't use it if flag_indirect_dispatch
is set.
Index: builtins.c
===================================================================
--- builtins.c (revision 115370)
+++ builtins.c (working copy)
@@ -293,6 +293,11 @@
method_arguments);
return result == NULL_TREE ? call : result;
}
+
+ /* Builtin functions emit a direct call which is incompatible
+ with the BC-ABI. */
+ if (flag_indirect_dispatch)
+ return call;
fn = built_in_decls[java_builtins[i].builtin_code];
if (fn == NULL_TREE)
return call;