This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

ia64 eh, part 18 [java]


I'm not sure why flag_non_call_exceptions is handled as it is.
I do recall I ran into some problem that I attributed to the 
frobbing.  In any case, it's not necessary since if there are no
catch clauses, there are no handlers, and thus can_throw_internal
must be false, and thus optimization is not impeaded.  Oh, and
catch_clauses is going away soon.

The move of flag_exceptions gets it set earlier, so that it's on
when init_eh runs.  Which may well be the actual bug I'd 
attributed to flag_non_call_exceptions some previous late night.


r~


        * decl.c (end_java_method): Do not save and restore
        flag_non_call_exceptions.
        * parse.y (source_end_java_method): Likewise.
        * lang.c (flag_exceptions): Don't declare.
        (java_init_options): Set flag_non_call_exceptions.  Set
        flag_exceptions here ...
        (java_init): ... not here.

Index: decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/decl.c,v
retrieving revision 1.96
diff -c -p -d -r1.96 decl.c
*** decl.c	2001/03/28 04:18:13	1.96
--- decl.c	2001/03/28 08:34:31
*************** void
*** 1827,1833 ****
  end_java_method ()
  {
    tree fndecl = current_function_decl;
-   int flag_flag_non_call_exceptions = flag_non_call_exceptions;
  
    expand_end_bindings (getdecls (), 1, 0);
    /* pop out of function */
--- 1827,1832 ----
*************** end_java_method ()
*** 1843,1860 ****
    /* Generate rtl for function exit.  */
    expand_function_end (input_filename, lineno, 0);
  
-   /* FIXME: If the current method contains any exception handlers,
-      force flag_non_call_exceptions: this is necessary because signal
-      handlers in libjava may throw exceptions.  This is far from being
-      a perfect solution, but it's better than doing nothing at all.*/
-   if (catch_clauses)
-     flag_non_call_exceptions = 1;
- 
    /* Run the optimizers and output assembler code for this function. */
    rest_of_compilation (fndecl);
  
    current_function_decl = NULL_TREE;
-   flag_non_call_exceptions = flag_flag_non_call_exceptions;
  }
  
  /* Mark language-specific parts of T for garbage-collection.  */
--- 1842,1851 ----
Index: lang.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/lang.c,v
retrieving revision 1.63
diff -c -p -d -r1.63 lang.c
*** lang.c	2001/03/28 06:11:49	1.63
--- lang.c	2001/03/28 08:34:31
*************** int flag_extraneous_semicolon;
*** 150,159 ****
  /* When non zero, always check for a non gcj generated classes archive.  */
  int flag_force_classes_archive_check;
  
- /* From gcc/flags.h, and indicates if exceptions are turned on or not.  */
- 
- extern int flag_exceptions;
- 
  /* Table of language-dependent -f options.
     STRING is the option name.  VARIABLE is the address of the variable.
     ON_VALUE is the value to store in VARIABLE
--- 150,155 ----
*************** java_init ()
*** 655,662 ****
    print_error_function = lang_print_error;
    lang_expand_expr = java_lang_expand_expr;
  
-   flag_exceptions = 1;
- 
    /* Append to Gcc tree node definition arrays */
  
    memcpy (tree_code_type + (int) LAST_AND_UNUSED_TREE_CODE,
--- 651,656 ----
*************** static void
*** 704,709 ****
--- 698,705 ----
  java_init_options ()
  {
    flag_bounds_check = 1;
+   flag_exceptions = 1;
+   flag_non_call_exceptions = 1;
  }
  
  const char *
Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.269
diff -c -p -d -r1.269 parse.y
*** parse.y	2001/03/28 05:04:20	1.269
--- parse.y	2001/03/28 08:34:31
*************** static void
*** 7117,7123 ****
  source_end_java_method ()
  {
    tree fndecl = current_function_decl;
-   int flag_flag_non_call_exceptions = flag_non_call_exceptions;
  
    if (!fndecl)
      return;
--- 7117,7122 ----
*************** source_end_java_method ()
*** 7153,7172 ****
        emit_handlers ();
        expand_function_end (input_filename, lineno, 0);
  
-       /* FIXME: If the current method contains any exception handlers,
- 	 force flag_non_call_exceptions: this is necessary because signal
- 	 handlers in libjava may throw exceptions.  This is far from being
- 	 a perfect solution, but it's better than doing nothing at all.*/
-       if (catch_clauses)
- 	flag_non_call_exceptions = 1;
- 
        /* Run the optimizers and output assembler code for this function. */
        rest_of_compilation (fndecl);
      }
  
    current_function_decl = NULL_TREE;
    java_parser_context_restore_global ();
-   flag_non_call_exceptions = flag_flag_non_call_exceptions;
  }
  
  /* Record EXPR in the current function block. Complements compound
--- 7152,7163 ----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]