objc is badly broken

Richard Kenner kenner@vlsi1.ultra.nyu.edu
Sat Feb 24 07:45:00 GMT 2001


It's failing a good percentage of its test suite and it looks like the
problems relate to an incomplete conversion to whole-function mode.

I fixed one problem but then got into a morass of problems relating to
internally-generated functions and didn't understand the code enough
to get further.  Here's my patch so far.  

I think this should either be fixed or objc disabled.

*** objc-act.c	2001/02/16 09:15:19	1.67
--- objc-act.c	2001/02/24 15:03:56
*************** hack_method_prototype (nst_methods, tmp_
*** 3111,3118 ****
    init_function_start (tmp_decl, "objc-act", 0);
  
!   /* Typically called from expand_function_start for function definitions.  */
!   assign_parms (tmp_decl);
  
!   /* install return type */
    TREE_TYPE (TREE_TYPE (tmp_decl)) = groktypename (TREE_TYPE (nst_methods));
  
--- 3111,3123 ----
    init_function_start (tmp_decl, "objc-act", 0);
  
!   /* Begin the statement tree for this function.  */
!   DECL_LANG_SPECIFIC (current_function_decl)
!     =((struct lang_decl *) ggc_alloc (sizeof (struct lang_decl)));
!   begin_stmt_tree (&DECL_SAVED_TREE (current_function_decl));
  
!   /* This function is being processed in whole-function mode.  */
!   cfun->x_whole_function_mode_p = 1;
! 
!   /* Install return type */
    TREE_TYPE (TREE_TYPE (tmp_decl)) = groktypename (TREE_TYPE (nst_methods));
  
*************** init_objc ()
*** 8162,8165 ****
--- 8167,8173 ----
  
    /* Change the default error function */
+   save_lang_status = &push_c_function_context;
+   restore_lang_status = &pop_c_function_context;
+   mark_lang_status = &mark_c_function_context;
    decl_printable_name = objc_printable_name;
    lang_expand_expr = c_expand_expr;



More information about the Gcc mailing list