]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorJeffrey A Law <law@cygnus.com>
Tue, 4 Jan 2000 09:24:24 +0000 (09:24 +0000)
committerJeff Law <law@gcc.gnu.org>
Tue, 4 Jan 2000 09:24:24 +0000 (02:24 -0700)
        Mon Oct 18 18:50:51 1999  Andreas Schwab  <schwab@suse.de>
        * config/m68k/m68k.h (INITIAL_FRAME_POINTER_OFFSET): Add one word
        if the pic register is used.

        Sat Sep 25 13:11:07 1999  Jeffrey A Law  (law@cygnus.com)
        * cse.c: Update comments.
        (cse_insn): When converting a conditional/computed jump into
        an unconditional jump, always make sure a BARRIER immediately
        follows the converted jump.  Do not delete unreachable code.
        (cse_basic_block): Do not delete unreachable code.
        * toplev.c (rest_of_compilation): Move call to
        delete_trivially_dead_insns after the conditional call to
        jump_optimize.

From-SVN: r31200

gcc/ChangeLog
gcc/config/m68k/m68k.h
gcc/cse.c
gcc/toplev.c

index 5570d349adad64da1dd9b8e54762ffb91ff8049c..80461a63b529303c9e7f1035d23be888961aa27f 100644 (file)
@@ -1,3 +1,20 @@
+Tue Jan  4 02:22:27 2000  Jeffrey A Law  (law@cygnus.com)
+
+       Mon Oct 18 18:50:51 1999  Andreas Schwab  <schwab@suse.de>
+       * config/m68k/m68k.h (INITIAL_FRAME_POINTER_OFFSET): Add one word
+       if the pic register is used.
+
+       Sat Sep 25 13:11:07 1999  Jeffrey A Law  (law@cygnus.com)
+       * cse.c: Update comments.
+       (cse_insn): When converting a conditional/computed jump into
+       an unconditional jump, always make sure a BARRIER immediately
+       follows the converted jump.  Do not delete unreachable code.
+       (cse_basic_block): Do not delete unreachable code.
+       * toplev.c (rest_of_compilation): Move call to
+       delete_trivially_dead_insns after the conditional call to
+       jump_optimize.
+
+
 Wed Dec 29 22:47:43 1999  Jeffrey A Law  (law@cygnus.com)
 
        1999-12-12  Stephen L Moshier <moshier@mediaone.net>
index 9a58f1db6bea2842ee222f4f912ab85010e85e6e..f7dee26e1aadec3f51bb205ce6646dc2dd0a7de6 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions of target machine for GNU compiler.  Sun 68000/68020 version.
-   Copyright (C) 1987, 88, 93-98, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1987, 88, 93-98, 1999, 2000 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -1198,6 +1198,8 @@ while(0)
   for (regno = 0; regno < 16; regno++)                         \
     if (regs_ever_live[regno] && ! call_used_regs[regno])      \
       offset += 4;                                             \
+  if (flag_pic && current_function_uses_pic_offset_table)      \
+    offset += 4;                                               \
   (DEPTH) = (offset + ((get_frame_size () + 3) & -4)           \
             + (get_frame_size () == 0 ? 0 : 4));               \
 }
index 7182b74024e9d6c93f9f2978e6d1bdb63eb3d345..e315610b3e288a982f36550b4ca7c582e4286304 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -1,5 +1,5 @@
 /* Common subexpression elimination for GNU compiler.
-   Copyright (C) 1987, 88, 89, 92-7, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1987, 88, 89, 92-99, 2000 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -42,12 +42,14 @@ Boston, MA 02111-1307, USA.  */
    expressions encountered with the cheapest equivalent expression.
 
    It is too complicated to keep track of the different possibilities
-   when control paths merge; so, at each label, we forget all that is
-   known and start fresh.  This can be described as processing each
-   basic block separately.  Note, however, that these are not quite
-   the same as the basic blocks found by a later pass and used for
-   data flow analysis and register packing.  We do not need to start fresh
-   after a conditional jump instruction if there is no label there.
+   when control paths merge in this code; so, at each label, we forget all
+   that is known and start fresh.  This can be described as processing each
+   extended basic block separately.  We have a separate pass to perform
+   global CSE.
+
+   Note CSE can turn a conditional or computed jump into a nop or
+   an unconditional jump.  When this occurs we arrange to run the jump
+   optimizer after CSE to delete the unreachable code.
 
    We use two data structures to record the equivalent expressions:
    a hash table for most expressions, and several vectors together
@@ -7468,7 +7470,6 @@ cse_insn (insn, libcall_insn)
              rtx new = emit_jump_insn_before (gen_jump (XEXP (src, 0)), insn);
              JUMP_LABEL (new) = XEXP (src, 0);
              LABEL_NUSES (XEXP (src, 0))++;
-             delete_insn (insn);
              insn = new;
            }
          else
@@ -7479,42 +7480,11 @@ cse_insn (insn, libcall_insn)
               Until the right place is found, might as well do this here.  */
            INSN_CODE (insn) = -1;
 
-         /* Now that we've converted this jump to an unconditional jump,
-            there is dead code after it.  Delete the dead code until we
-            reach a BARRIER, the end of the function, or a label.  Do
-            not delete NOTEs except for NOTE_INSN_DELETED since later
-            phases assume these notes are retained.  */
-
-         p = insn;
-
-         while (NEXT_INSN (p) != 0
-                && GET_CODE (NEXT_INSN (p)) != BARRIER
-                && GET_CODE (NEXT_INSN (p)) != CODE_LABEL)
-           {
-             /* Note, we must update P with the return value from
-                delete_insn, otherwise we could get an infinite loop
-                if NEXT_INSN (p) had INSN_DELETED_P set.  */
-             if (GET_CODE (NEXT_INSN (p)) != NOTE
-                 || NOTE_LINE_NUMBER (NEXT_INSN (p)) == NOTE_INSN_DELETED)
-               p = PREV_INSN (delete_insn (NEXT_INSN (p)));
-             else
-               p = NEXT_INSN (p);
-           }
-
-         /* If we don't have a BARRIER immediately after INSN, put one there.
-            Much code assumes that there are no NOTEs between a JUMP_INSN and
-            BARRIER.  */
-
-         if (NEXT_INSN (insn) == 0
-             || GET_CODE (NEXT_INSN (insn)) != BARRIER)
-           emit_barrier_before (NEXT_INSN (insn));
-
-         /* We might have two BARRIERs separated by notes.  Delete the second
-            one if so.  */
-
-         if (p != insn && NEXT_INSN (p) != 0
-             && GET_CODE (NEXT_INSN (p)) == BARRIER)
-           delete_insn (NEXT_INSN (p));
+         /* Now emit a BARRIER after the unconditional jump.  Do not bother
+            deleting any unreachable code, let jump/flow do that.  */
+         if (NEXT_INSN (insn) != 0
+             && GET_CODE (NEXT_INSN (insn)) != BARRIER)
+           emit_barrier_after (insn);
 
          cse_jumps_altered = 1;
          sets[i].rtl = 0;
@@ -9007,9 +8977,6 @@ cse_basic_block (from, to, next_branch, around_loop)
 
          insn = NEXT_INSN (to);
 
-         if (LABEL_NUSES (to) == 0)
-           insn = delete_insn (to);
-
          /* If TO was the last insn in the function, we are done.  */
          if (insn == 0)
            return 0;
index 9dac1fdbd9ce6c644777965a5ae5d31d0105d607..99e0b719ba34c3011569a0d3deb7526daa6cb89e 100644 (file)
@@ -1,5 +1,5 @@
 /* Top level of GNU C compiler
-   Copyright (C) 1987, 88, 89, 92-98, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1987, 88, 89, 92-99, 2000 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -3870,13 +3870,15 @@ rest_of_compilation (decl)
 
       TIMEVAR (cse_time, tem = cse_main (insns, max_reg_num (),
                                         0, rtl_dump_file));
-      TIMEVAR (cse_time, delete_trivially_dead_insns (insns, max_reg_num ()));
-
       if (tem || optimize > 1)
        TIMEVAR (jump_time, jump_optimize (insns, !JUMP_CROSS_JUMP,
                                           !JUMP_NOOP_MOVES,
                                           !JUMP_AFTER_REGSCAN));
 
+      /* Run this after jump optmizations remove all the unreachable code
+        so that unreachable code will not keep values live.  */
+      TIMEVAR (cse_time, delete_trivially_dead_insns (insns, max_reg_num ()));
+
       /* Dump rtl code after cse, if we are doing that.  */
 
       if (cse_dump)