]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/3783 (gcc3.0/ia64 ICE on linux kernel file fs/ufs/super.c)
authorJim Wilson <wilson@redhat.com>
Fri, 7 Sep 2001 23:25:01 +0000 (23:25 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Fri, 7 Sep 2001 23:25:01 +0000 (16:25 -0700)
Fix for PR 3783.
* alias.c (clear_reg_alias_info): New.
* flow.c (attempt_auto_inc): Call clear_reg_alias_info.
* rtl.h (clear_reg_alias_info): Declare.

From-SVN: r45482

gcc/ChangeLog
gcc/alias.c
gcc/flow.c
gcc/rtl.h

index 559e8b43c1714aa3184be092d2771286bbd98f43..c3dc8f418d2a00f55d387e465b1075fd6c89c201 100644 (file)
@@ -1,3 +1,9 @@
+2001-09-07  Jim Wilson  <wilson@redhat.com>
+
+       * alias.c (clear_reg_alias_info): New.
+       * flow.c (attempt_auto_inc): Call clear_reg_alias_info.
+       * rtl.h (clear_reg_alias_info): Declare.
+
 2001-09-07  Roman Lechtchinsky  <rl@cs.tu-berlin.de>
 
        * real.c (EMUSHORT,EMUSHORT_SIZE): Use HImode if no 16-bit type is
index d8e9d42e3b319ec40132c9bbf6fa16e7c905f23b..8c6ad5f0eb33384cbfcfa0be661cb16307ef2d5d 100644 (file)
@@ -960,6 +960,20 @@ record_base_value (regno, val, invariant)
   reg_base_value[regno] = find_base_value (val);
 }
 
+/* Clear alias info for a register.  This is used if an RTL transformation
+   changes the value of a register.  This is used in flow by AUTO_INC_DEC
+   optimizations.  We don't need to clear reg_base_value, since flow only
+   changes the offset.  */
+
+void
+clear_reg_alias_info (rtx reg)
+{
+  int regno = REGNO (reg);
+
+  if (regno < reg_known_value_size)
+    reg_known_value[regno] = reg;
+}
+
 /* Returns a canonical version of X, from the point of view alias
    analysis.  (For example, if X is a MEM whose address is a register,
    and the register has a known value (say a SYMBOL_REF), then a MEM
index 8ca087757dd443cebce408db48cc1fa1fb4afb09..1cbb0f8f82a698eeda3081abef2bbf16d31341ef 100644 (file)
@@ -7027,6 +7027,9 @@ attempt_auto_inc (pbi, inc, insn, mem, incr, incr_reg)
       for (temp = insn; temp != incr; temp = NEXT_INSN (temp))
        if (GET_CODE (temp) == CALL_INSN)
          REG_N_CALLS_CROSSED (regno)++;
+
+      /* Invalidate alias info for Q since we just changed its value.  */
+      clear_reg_alias_info (q);
     }
   else
     return;
index 75204b66de865deef164dfffe8dfe2fd20d638fa..d99388866e0119e581e2b87a9e6311b1abdcba15 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1988,6 +1988,7 @@ extern void fancy_abort PARAMS ((const char *, int, const char *))
 #define abort() fancy_abort (__FILE__, __LINE__, __FUNCTION__)
 
 /* In alias.c */
+extern void clear_reg_alias_info       PARAMS ((rtx));
 extern rtx canon_rtx                    PARAMS ((rtx));
 extern int true_dependence             PARAMS ((rtx, enum machine_mode, rtx,
                                                int (*)(rtx, int)));