]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
avr.c (avr_hard_regno_mode_ok): Do not allow r29 which may overwrite the high byte...
authorMarek Michalkiewicz <marekm@amelek.gda.pl>
Sun, 19 May 2002 15:09:38 +0000 (17:09 +0200)
committerMarek Michalkiewicz <marekm@gcc.gnu.org>
Sun, 19 May 2002 15:09:38 +0000 (15:09 +0000)
2002-02-28  Marek Michalkiewicz  <marekm@amelek.gda.pl>
* config/avr/avr.c (avr_hard_regno_mode_ok): Do not allow r29
which may overwrite the high byte of the frame pointer.

From-SVN: r53626

gcc/ChangeLog
gcc/config/avr/avr.c

index 7f38f4f2faecc5729191d372db4339dac35ac070..4a550985d0976914c461ae6bfb555f5a0771dbcd 100644 (file)
@@ -4,6 +4,10 @@
        * config/avr/avr.md (length): Fix length computation for
        conditional branches.
 
+       2002-02-28  Marek Michalkiewicz  <marekm@amelek.gda.pl>
+       * config/avr/avr.c (avr_hard_regno_mode_ok): Do not allow r29
+       which may overwrite the high byte of the frame pointer.
+
 2002-05-03  Jakub Jelinek  <jakub@redhat.com>
 
        * cppinit.c (cpp_handle_option) [-dM]: Don't set no_output here...
index b1e44bf8071940b5b54920899f4b2d1fef817ef1..bba79495cb1b87f2e076fec86422c2310bfa86bd 100644 (file)
@@ -5214,6 +5214,13 @@ avr_hard_regno_mode_ok (regno, mode)
      int regno;
      enum machine_mode mode;
 {
+  /* Bug workaround: recog.c (peep2_find_free_register) and probably
+     a few other places assume that the frame pointer is a single hard
+     register, so r29 may be allocated and overwrite the high byte of
+     the frame pointer.  Do not allow any value to start in r29.  */
+  if (regno == REG_Y + 1)
+    return 0;
+
   if (mode == QImode)
     return 1;
   /*  if (regno < 24 && !AVR_ENHANCED)