re PR rtl-optimization/13041 (linux-2.6/sound/core/oss/rate.c miscompiled)
authorEric Botcazou <ebotcazou@libertysurf.fr>
Thu, 27 Nov 2003 06:45:25 +0000 (07:45 +0100)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 27 Nov 2003 06:45:25 +0000 (06:45 +0000)
PR optimization/13041
* final.c (frame_pointer_needed): Fix comment.
* reload1.c (reload): Decrease alignment of the frame
pointer if it was used for register allocation.

From-SVN: r73978

gcc/ChangeLog
gcc/final.c
gcc/reload1.c

index 419e698e57c31087271b5f738c9a179a36d4450f..95510a02fef4e4655087960edbd820f979625ec9 100644 (file)
@@ -1,3 +1,10 @@
+2003-11-27  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       PR optimization/13041
+       * final.c (frame_pointer_needed): Fix comment.
+       * reload1.c (reload): Decrease alignment of the frame
+       pointer if it was used for register allocation.
+
 2003-11-27  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        PR target/12900
index f8750e98872f8109c526c289508f2f22d1bc24c3..fe3ff6eeff43da0df4852ec04a5c240da00aaa72 100644 (file)
@@ -171,8 +171,8 @@ CC_STATUS cc_prev_status;
 char regs_ever_live[FIRST_PSEUDO_REGISTER];
 
 /* Nonzero means current function must be given a frame pointer.
-   Set in stmt.c if anything is allocated on the stack there.
-   Set in reload1.c if anything is allocated on the stack there.  */
+   Initialized in function.c to 0.  Set only in reload1.c as per
+   the needs of the function.  */
 
 int frame_pointer_needed;
 
index 22c03421a012f0cd737f88aab040eab335fea0e3..64dc0be4bf481f4b20744b57ae29f072613259b1 100644 (file)
@@ -1241,6 +1241,14 @@ reload (rtx first, int global)
      by this, so unshare everything here.  */
   unshare_all_rtl_again (first);
 
+#ifdef STACK_BOUNDARY
+  /* init_emit has set the alignment of the hard frame pointer
+     to STACK_BOUNDARY.  It is very likely no longer valid if
+     the hard frame pointer was used for register allocation.  */
+  if (!frame_pointer_needed)
+    REGNO_POINTER_ALIGN (HARD_FRAME_POINTER_REGNUM) = BITS_PER_UNIT;
+#endif
+
   return failure;
 }