]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
objc-act.c: Include cgraph.h
authorJan Hubicka <jh@suse.cz>
Wed, 26 Feb 2003 11:09:33 +0000 (12:09 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Wed, 26 Feb 2003 11:09:33 +0000 (11:09 +0000)
* objc-act.c: Include cgraph.h
(mark_referenced_methods): New function.
(objc_init): Call it.
* objc-lang.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Set.

* c-decl.c (finish_function): Honor can_defer_p even in unit-at-a-time
mode.

* optabs.c (expand_fix): Do not widen the input operand.

* expr.c (emit_group_store):  Fix crash when converting single
register into complex register.

* Makefile.in (jump.o, regclass.o, alias.o): Add dependency on timevar.h
* alias.c: Include timevar.h
(init_alias_analysis):  Set timevar
* jump.c: Include timevar.h
(rebuild_jump_labels):  Set timevar
* regcalss.c: Include timevar.h
(reg_scan):  Set timevar
* timevar.def (TV_ALIAS_ANALYSIS, TV_REG_SCAN, TV_REBUILD_JUMP): New

From-SVN: r63464

gcc/ChangeLog
gcc/Makefile.in
gcc/alias.c
gcc/c-decl.c
gcc/expr.c
gcc/jump.c
gcc/objc/objc-act.c
gcc/objc/objc-lang.c
gcc/optabs.c
gcc/regclass.c
gcc/timevar.def

index 6e1633b45719977ee07bd24a26d151c17dbad91d..b3fc381d9a59232ce4d6168dc0ce5fa7da023aec 100644 (file)
@@ -1,3 +1,27 @@
+Tue Feb 25 22:46:27 CET 2003  Jan Hubicka  <jh@suse.cz>
+
+       * objc-act.c: Include cgraph.h
+       (mark_referenced_methods): New function.
+       (objc_init): Call it.
+       * objc-lang.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Set.
+
+       * c-decl.c (finish_function): Honor can_defer_p even in unit-at-a-time
+       mode.
+
+       * optabs.c (expand_fix): Do not widen the input operand.
+
+       * expr.c (emit_group_store):  Fix crash when converting single
+       register into complex register.
+
+       * Makefile.in (jump.o, regclass.o, alias.o): Add dependency on timevar.h
+       * alias.c: Include timevar.h
+       (init_alias_analysis):  Set timevar
+       * jump.c: Include timevar.h
+       (rebuild_jump_labels):  Set timevar
+       * regcalss.c: Include timevar.h
+       (reg_scan):  Set timevar
+       * timevar.def (TV_ALIAS_ANALYSIS, TV_REG_SCAN, TV_REBUILD_JUMP): New
+
 2003-02-26  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
 
        * cse.c (count_reg_usage): Fix handling of REG_EQUAL notes.
index 600fea65f7a5069d4312bc9fd7cba754bbf94995..9510321e339a08b8ccb904e6e0a2163be44e68b0 100644 (file)
@@ -1526,7 +1526,7 @@ integrate.o : integrate.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $
    $(PARAMS_H) $(TM_P_H) $(TARGET_H) langhooks.h gt-integrate.h
 jump.o : jump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
    hard-reg-set.h $(REGS_H) insn-config.h $(RECOG_H) $(EXPR_H) real.h except.h function.h \
-   toplev.h $(INSN_ATTR_H) $(TM_P_H) reload.h $(PREDICT_H)
+   toplev.h $(INSN_ATTR_H) $(TM_P_H) reload.h $(PREDICT_H) $(TIMEVAR_H)
 
 simplify-rtx.o : simplify-rtx.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
    $(REGS_H) hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
@@ -1623,7 +1623,7 @@ combine.o : combine.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags
    $(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h toplev.h $(TM_P_H)
 regclass.o : regclass.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
    hard-reg-set.h flags.h $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(RECOG_H) reload.h \
-   real.h toplev.h function.h output.h $(GGC_H) $(TM_P_H) $(EXPR_H)
+   real.h toplev.h function.h output.h $(GGC_H) $(TM_P_H) $(EXPR_H) $(TIMEVAR_H)
 local-alloc.o : local-alloc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
    flags.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \
    output.h function.h $(INSN_ATTR_H) toplev.h  except.h $(TM_P_H)
@@ -1664,7 +1664,7 @@ reorg.o : reorg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) condition
 alias.o : alias.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
    hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) toplev.h output.h $(EXPR_H) \
    $(GGC_H) function.h cselib.h $(TREE_H) $(TM_P_H) langhooks.h $(TARGET_H) \
-   gt-alias.h
+   gt-alias.h $(TIMEVAR_H)
 regmove.o : regmove.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) insn-config.h \
    $(RECOG_H) output.h $(REGS_H) hard-reg-set.h flags.h function.h \
    $(EXPR_H) $(BASIC_BLOCK_H) toplev.h $(TM_P_H) except.h reload.h
index de8d8d7c221de78d6a02a0b74cf04dc6dc5272a0..9be3aa05534d86ef733582e43463cef8c5e12cdb 100644 (file)
@@ -39,6 +39,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "splay-tree.h"
 #include "ggc.h"
 #include "langhooks.h"
+#include "timevar.h"
 #include "target.h"
 
 /* The alias sets assigned to MEMs assist the back-end in determining
@@ -2745,6 +2746,8 @@ init_alias_analysis ()
   unsigned int ui;
   rtx insn;
 
+  timevar_push (TV_ALIAS_ANALYSIS);
+
   reg_known_value_size = maxreg;
 
   reg_known_value
@@ -2950,6 +2953,7 @@ init_alias_analysis ()
   new_reg_base_value = 0;
   free (reg_seen);
   reg_seen = 0;
+  timevar_pop (TV_ALIAS_ANALYSIS);
 }
 
 void
index 66a57dbe5053ea8606a4bd7c9057703f2603ee6c..a5bb317bde7c524599152be83daeef7b8ce20558 100644 (file)
@@ -6413,7 +6413,7 @@ finish_function (nested, can_defer_p)
   free_after_compilation (cfun);
   cfun = NULL;
 
-  if (flag_unit_at_a_time)
+  if (flag_unit_at_a_time && can_defer_p)
     {
       cgraph_finalize_function (fndecl, DECL_SAVED_TREE (fndecl));
       current_function_decl = NULL;
index d8f4c7967eaf2a255d43379a585fbe4bb140f5bc..9643a558c731ef7ecf5e89b49730f2c434308854 100644 (file)
@@ -2477,6 +2477,15 @@ emit_group_store (orig_dst, src, ssize)
              bytepos -= GET_MODE_SIZE (GET_MODE (XEXP (dst, 0)));
              dest = XEXP (dst, 1);
            }
+         else if (bytepos == 0 && XVECLEN (src, 0))
+           {
+             dest = assign_stack_temp (GET_MODE (dest),
+                                       GET_MODE_SIZE (GET_MODE (dest)), 0);
+             emit_move_insn (adjust_address (dest, GET_MODE (tmps[i]), bytepos),
+                             tmps[i]);
+             dst = dest;
+             break;
+           }
          else
            abort ();
        }
@@ -2495,7 +2504,7 @@ emit_group_store (orig_dst, src, ssize)
   emit_queue ();
 
   /* Copy from the pseudo into the (probable) hard reg.  */
-  if (GET_CODE (dst) == REG)
+  if (orig_dst != dst)
     emit_move_insn (orig_dst, dst);
 }
 
index e18abef51a781f290c0d318317df4b3835584023..15c9d36618f53dc09cb30a7d752d0425208d03c6 100644 (file)
@@ -53,6 +53,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "toplev.h"
 #include "reload.h"
 #include "predict.h"
+#include "timevar.h"
 
 /* Optimize jump y; x: ... y: jumpif... x?
    Don't know if it is worth bothering with.  */
@@ -82,6 +83,7 @@ rebuild_jump_labels (f)
 {
   rtx insn;
 
+  timevar_push (TV_REBUILD_JUMP);
   init_label_info (f);
   mark_all_labels (f);
 
@@ -92,6 +94,7 @@ rebuild_jump_labels (f)
   for (insn = forced_labels; insn; insn = XEXP (insn, 1))
     if (GET_CODE (XEXP (insn, 0)) == CODE_LABEL)
       LABEL_NUSES (XEXP (insn, 0))++;
+  timevar_pop (TV_REBUILD_JUMP);
 }
 \f
 /* Some old code expects exactly one BARRIER as the NEXT_INSN of a
index fb3b79f925880a2cb27a300d27de2fc0e7d6c4ed..3dace91ff1097b141e528d717a8303b5f7e8a8e5 100644 (file)
@@ -60,6 +60,7 @@ Boston, MA 02111-1307, USA.  */
 #include "debug.h"
 #include "target.h"
 #include "diagnostic.h"
+#include "cgraph.h"
 
 /* This is the default way of generating a method name.  */
 /* I am not sure it is really correct.
@@ -294,6 +295,7 @@ static void handle_class_ref                        PARAMS ((tree));
 static void generate_struct_by_value_array     PARAMS ((void))
      ATTRIBUTE_NORETURN;
 static void encode_complete_bitfield           PARAMS ((int, tree, int));
+static void mark_referenced_methods            PARAMS ((void));
 
 /*** Private Interface (data) ***/
 
@@ -486,6 +488,7 @@ objc_init (filename)
 void
 finish_file ()
 {
+  mark_referenced_methods ();
   c_objc_common_finish_file ();
 
   /* Finalize Objective-C runtime data.  No need to generate tables
@@ -4027,6 +4030,29 @@ generate_dispatch_table (type, name, size, list)
   return decl;
 }
 
+static void
+mark_referenced_methods ()
+{
+  struct imp_entry *impent;
+  tree chain;
+
+  for (impent = imp_list; impent; impent = impent->next)
+    {
+      chain = CLASS_CLS_METHODS (impent->imp_context);
+      while (chain)
+       {
+         cgraph_mark_needed_node (cgraph_node (METHOD_DEFINITION (chain)));
+         chain = TREE_CHAIN (chain);
+       }
+      chain = CLASS_NST_METHODS (impent->imp_context);
+      while (chain)
+       {
+         cgraph_mark_needed_node (cgraph_node (METHOD_DEFINITION (chain)));
+         chain = TREE_CHAIN (chain);
+       }
+    }
+}
+
 static void
 generate_dispatch_tables ()
 {
index ff17f0fd249d9cf6f425fa675b41e331d8119075..686e35e3d66bce7233bca1b0ca7bcd19b250119c 100644 (file)
@@ -99,6 +99,9 @@ static void objc_init_options                   PARAMS ((void));
 #define LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING \
   c_convert_parm_for_inlining
 
+#undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION
+#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION c_expand_body
+
 #undef LANG_HOOKS_TYPE_FOR_MODE
 #define LANG_HOOKS_TYPE_FOR_MODE c_common_type_for_mode
 #undef LANG_HOOKS_TYPE_FOR_SIZE
index 93b14984c3144d527fc0c99f46243a096ec5fad8..e30e47720ca57433bd03f88aa1d031ee7ba26072 100644 (file)
@@ -5119,15 +5119,26 @@ expand_fix (to, from, unsignedp)
      one plus the highest signed number, convert, and add it back.
 
      We only need to check all real modes, since we know we didn't find
-     anything with a wider integer mode.  */
+     anything with a wider integer mode.  
+
+     This code used to extend FP value into mode wider than the destination.
+     This is not needed.  Consider, for instance conversion from SFmode
+     into DImode.
+
+     The hot path trought the code is dealing with inputs smaller than 2^63
+     and doing just the conversion, so there is no bits to lose.
+
+     In the other path we know the value is positive in the range 2^63..2^64-1
+     inclusive.  (as for other imput overflow happens and result is undefined)
+     So we know that the most important bit set in mantisa corresponds to
+     2^63.  The subtraction of 2^63 should not generate any rounding as it
+     simply clears out that bit.  The rest is trivial.  */
 
   if (unsignedp && GET_MODE_BITSIZE (GET_MODE (to)) <= HOST_BITS_PER_WIDE_INT)
     for (fmode = GET_MODE (from); fmode != VOIDmode;
         fmode = GET_MODE_WIDER_MODE (fmode))
-      /* Make sure we won't lose significant bits doing this.  */
-      if (GET_MODE_BITSIZE (fmode) > GET_MODE_BITSIZE (GET_MODE (to))
-         && CODE_FOR_nothing != can_fix_p (GET_MODE (to), fmode, 0,
-                                           &must_trunc))
+      if (CODE_FOR_nothing != can_fix_p (GET_MODE (to), fmode, 0,
+                                        &must_trunc))
        {
          int bitsize;
          REAL_VALUE_TYPE offset;
index fe6f0a775e243d4969d9cc7046c1305e821f0ce1..abbd6eabe3d50c01a3eccd725dcc723a8de6df63 100644 (file)
@@ -43,6 +43,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "toplev.h"
 #include "output.h"
 #include "ggc.h"
+#include "timevar.h"
 
 #ifndef REGISTER_MOVE_COST
 #define REGISTER_MOVE_COST(m, x, y) 2
@@ -2338,6 +2339,8 @@ reg_scan (f, nregs, repeat)
   max_parallel = 3;
   max_set_parallel = 0;
 
+  timevar_push (TV_REG_SCAN);
+
   for (insn = f; insn; insn = NEXT_INSN (insn))
     if (GET_CODE (insn) == INSN
        || GET_CODE (insn) == CALL_INSN
@@ -2353,6 +2356,8 @@ reg_scan (f, nregs, repeat)
       }
 
   max_parallel += max_set_parallel;
+
+  timevar_pop (TV_REG_SCAN);
 }
 
 /* Update 'regscan' information by looking at the insns
index ced2c7b10c3ae811b46aa04c3c991ee3262cb3d1..f8a32f63a8fb11eccd74773c673c8615c63cf83e 100644 (file)
@@ -47,6 +47,10 @@ DEFTIMEVAR (TV_DELETE_TRIVIALLY_DEAD , "trivially dead code")
 /* Time spent by life analysis.  */
 DEFTIMEVAR (TV_LIFE                 , "life analysis")
 DEFTIMEVAR (TV_LIFE_UPDATE          , "life info update")
+
+DEFTIMEVAR (TV_ALIAS_ANALYSIS       , "alias analysis")
+DEFTIMEVAR (TV_REG_SCAN                     , "register scan")
+DEFTIMEVAR (TV_REBUILD_JUMP         , "rebuild jump labels")
 /* Timing in various stages of the compiler.  */
 DEFTIMEVAR (TV_CPP                  , "preprocessing")
 DEFTIMEVAR (TV_LEX                  , "lexical analysis")