ira.c (clarify_prohibited_class_mode_regs): Prevent the function from accessing beyon...
authorHariharan Sandanagobalane <hariharan@picochip.com>
Thu, 12 May 2011 11:12:12 +0000 (11:12 +0000)
committerHariharan Sandanagobalane <hariharans@gcc.gnu.org>
Thu, 12 May 2011 11:12:12 +0000 (11:12 +0000)
         * ira.c (clarify_prohibited_class_mode_regs): Prevent the function from
          accessing beyond the end of REGNO_REG_CLASS array by stopping the
          loop early.

From-SVN: r173699

gcc/ChangeLog
gcc/ira.c

index 8dcd8b95fd8691787f130add9503f89d7d6f603b..4bb674995f7a47aa56b3745609b4a2f5c58bcfe8 100644 (file)
@@ -1,3 +1,9 @@
+2011-05-12  Hariharan Sandanagobalane <hariharan@picochip.com>
+
+       * ira.c (clarify_prohibited_class_mode_regs): Prevent the function from
+       accessing beyond the end of REGNO_REG_CLASS array by stopping the loop
+       early.
+
 2011-05-12  DJ Delorie  <dj@redhat.com>
 
        (rx_builtins): New arrays - holds builtin functions.
index 32dfa18ce19882217a1bd9db2148c302141e2ef6..9235cb3f94ba74e42e301ed33fd5602859fb14b4 100644 (file)
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -1422,6 +1422,12 @@ clarify_prohibited_class_mode_regs (void)
          if (TEST_HARD_REG_BIT (ira_prohibited_class_mode_regs[cl][j], hard_regno))
            continue;
          nregs = hard_regno_nregs[hard_regno][j];
+          if (hard_regno + nregs > FIRST_PSEUDO_REGISTER)
+            {
+              SET_HARD_REG_BIT (ira_prohibited_class_mode_regs[cl][j],
+                                hard_regno);
+               continue;
+            }
          pclass = ira_pressure_class_translate[REGNO_REG_CLASS (hard_regno)];
          for (nregs-- ;nregs >= 0; nregs--)
            if (((enum reg_class) pclass