Commit 0b094f65 by Andrew Haley Committed by Andrew Haley

lang.c (flag_use_divide_subroutine): New variable.

1999-07-15  Andrew Haley  <aph@cygnus.com>

        * lang.c (flag_use_divide_subroutine): New variable.
        * typeck.c: (convert_ieee_real_to_integer): Bounds check
        fp-to-integer conversion.
        (convert): Call convert_ieee_real_to_integer when flag_fast_math
        is not set.

        * expr.c (build_java_soft_divmod): New function.
        (build_java_binop): Call build_java_soft_divmod if
        flag_use_divide_subroutine is set.
        * decl.c: soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
        soft_lrem_node: new builtin functions.
        (init_decl_processing) Initialize the new builtins.
        * java-tree.h soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
        soft_lrem_node: new builtin functions.
        (build_java_soft_divmod): New function.
        * parse.y: Call build_java_soft_divmod if
        flag_use_divide_subroutine is set.
        * parse.c: Rebuilt.

        * jvspec.c (lang_specific_driver): Always allow an extra arg (for
        a --specs= arg) even if not linking.
        * lang-options.h (DEFINE_LANG_NAME ("Java")): Add
        -fuse-divide-subroutine

From-SVN: r28209
parent aa4759c1
1999-07-15 Andrew Haley <aph@cygnus.com> 1999-07-15 Andrew Haley <aph@cygnus.com>
* lang.c (flag_use_divide_subroutine): New variable. * lang.c (flag_use_divide_subroutine): New variable.
* typeck.c: (convert_ieee_real_to_integer): Bounds check * typeck.c: (convert_ieee_real_to_integer): Bounds check
fp-to-integer conversion. fp-to-integer conversion.
(convert): Call convert_ieee_real_to_integer when flag_fast_math (convert): Call convert_ieee_real_to_integer when flag_fast_math
is not set. is not set.
* expr.c (build_java_soft_divmod): New function. * expr.c (build_java_soft_divmod): New function.
(build_java_binop): Call build_java_soft_divmod if (build_java_binop): Call build_java_soft_divmod if
flag_use_divide_subroutine is set. flag_use_divide_subroutine is set.
* decl.c: soft_idiv_node, soft_irem_node, soft_ldiv_node, tree * decl.c: soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
soft_lrem_node: new builtin functions. soft_lrem_node: new builtin functions.
(init_decl_processing) Initialize the new builtins. (init_decl_processing) Initialize the new builtins.
* java-tree.h soft_idiv_node, soft_irem_node, soft_ldiv_node, tree * java-tree.h soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
soft_lrem_node: new builtin functions. soft_lrem_node: new builtin functions.
(build_java_soft_divmod): New function. (build_java_soft_divmod): New function.
* parse.y: Call build_java_soft_divmod if * parse.y: Call build_java_soft_divmod if
flag_use_divide_subroutine is set. flag_use_divide_subroutine is set.
* parse.c: Rebuilt.
* jvspec.c (lang_specific_driver): Always allow an extra arg (for
a --specs= arg) even if not linking.
* lang-options.h (DEFINE_LANG_NAME ("Java")): Add
-fuse-divide-subroutine
Tue Jul 20 13:20:05 1999 Alexandre Petit-Bianco <apbianco@cygnus.com> Tue Jul 20 13:20:05 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (resolve_and_layout): Check methods only once. * parse.y (resolve_and_layout): Check methods only once.
......
...@@ -376,8 +376,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) ...@@ -376,8 +376,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
} }
if (saw_g + saw_O == 0) if (saw_g + saw_O == 0)
num_args++; num_args++;
if (will_link) num_args++;
num_args++;
arglist = (char **) xmalloc ((num_args + 1) * sizeof (char *)); arglist = (char **) xmalloc ((num_args + 1) * sizeof (char *));
for (i = 0, j = 0; i < argc; i++, j++) for (i = 0, j = 0; i < argc; i++, j++)
...@@ -408,7 +407,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) ...@@ -408,7 +407,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
continue; continue;
} }
if (will_link && spec_file == NULL && strncmp (argv[i], "-L", 2) == 0) if (spec_file == NULL && strncmp (argv[i], "-L", 2) == 0)
spec_file = find_spec_file (argv[i] + 2); spec_file = find_spec_file (argv[i] + 2);
if (strncmp (argv[i], "-fmain=", 7) == 0) if (strncmp (argv[i], "-fmain=", 7) == 0)
...@@ -453,10 +452,10 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) ...@@ -453,10 +452,10 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
if (saw_g + saw_O == 0) if (saw_g + saw_O == 0)
arglist[j++] = "-g1"; arglist[j++] = "-g1";
/* Read the specs file corresponding to libgcj, but only if linking. /* Read the specs file corresponding to libgcj.
If we didn't find the spec file on the -L path, then we hope it If we didn't find the spec file on the -L path, then we hope it
is somewhere in the standard install areas. */ is somewhere in the standard install areas. */
if (will_link) if (! saw_C)
arglist[j++] = spec_file == NULL ? "-specs=libgcj.spec" : spec_file; arglist[j++] = spec_file == NULL ? "-specs=libgcj.spec" : spec_file;
if (saw_C) if (saw_C)
......
...@@ -43,6 +43,8 @@ DEFINE_LANG_NAME ("Java") ...@@ -43,6 +43,8 @@ DEFINE_LANG_NAME ("Java")
{ "-fCLASSPATH", "Set class path" }, { "-fCLASSPATH", "Set class path" },
{ "-I", "Add directory to class path" }, { "-I", "Add directory to class path" },
{ "-foutput-class-dir", "Directory where class files should be written" }, { "-foutput-class-dir", "Directory where class files should be written" },
{ "-fuse-divide-subroutine", "" },
{ "-fno-use-divide-subroutine", "Use built-in instructions for division" },
{ "-Wredundant-modifiers", { "-Wredundant-modifiers",
"Warn if modifiers are specified when not necessary"}, "Warn if modifiers are specified when not necessary"},
{ "-Wunsupported-jdk11", "Warn if `final' local variables are specified"}, { "-Wunsupported-jdk11", "Warn if `final' local variables are specified"}
...@@ -2212,7 +2212,7 @@ static const short yycheck[] = { 3, ...@@ -2212,7 +2212,7 @@ static const short yycheck[] = { 3,
#define YYPURE 1 #define YYPURE 1
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line 3 "/usr/share/misc/bison.simple" #line 3 "/usr/local/share/bison.simple"
/* Skeleton output parser for bison, /* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
...@@ -2229,7 +2229,7 @@ static const short yycheck[] = { 3, ...@@ -2229,7 +2229,7 @@ static const short yycheck[] = { 3,
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* As a special exception, when this file is copied by Bison into a /* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction. Bison output file, you may use that output file without restriction.
...@@ -2363,10 +2363,8 @@ int yydebug; /* nonzero means print parse trace */ ...@@ -2363,10 +2363,8 @@ int yydebug; /* nonzero means print parse trace */
/* Prevent warning if -Wstrict-prototypes. */ /* Prevent warning if -Wstrict-prototypes. */
#ifdef __GNUC__ #ifdef __GNUC__
#ifndef YYPARSE_PARAM
int yyparse (void); int yyparse (void);
#endif #endif
#endif
#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
...@@ -2407,7 +2405,7 @@ __yy_memcpy (char *to, char *from, int count) ...@@ -2407,7 +2405,7 @@ __yy_memcpy (char *to, char *from, int count)
#endif #endif
#endif #endif
#line 196 "/usr/share/misc/bison.simple" #line 196 "/usr/local/share/bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed /* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *. into yyparse. The argument should have type void *.
...@@ -4696,7 +4694,7 @@ case 495: ...@@ -4696,7 +4694,7 @@ case 495:
break;} break;}
} }
/* the action file gets copied in in place of this dollarsign */ /* the action file gets copied in in place of this dollarsign */
#line 498 "/usr/share/misc/bison.simple" #line 498 "/usr/local/share/bison.simple"
yyvsp -= yylen; yyvsp -= yylen;
yyssp -= yylen; yyssp -= yylen;
...@@ -11998,6 +11996,12 @@ patch_binop (node, wfl_op1, wfl_op2) ...@@ -11998,6 +11996,12 @@ patch_binop (node, wfl_op1, wfl_op2)
if (code == RDIV_EXPR && TREE_CODE (prom_type) == INTEGER_TYPE) if (code == RDIV_EXPR && TREE_CODE (prom_type) == INTEGER_TYPE)
TREE_SET_CODE (node, TRUNC_DIV_EXPR); TREE_SET_CODE (node, TRUNC_DIV_EXPR);
if (TREE_CODE (prom_type) == INTEGER_TYPE
&& flag_use_divide_subroutine
&& ! flag_emit_class_files
&& (code == RDIV_EXPR || code == TRUNC_MOD_EXPR))
return build_java_soft_divmod (TREE_CODE (node), prom_type, op1, op2);
/* This one is more complicated. FLOATs are processed by a /* This one is more complicated. FLOATs are processed by a
function call to soft_fmod. Duplicate the value of the function call to soft_fmod. Duplicate the value of the
COMPOUND_ASSIGN_P flag. */ COMPOUND_ASSIGN_P flag. */
......
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