From b483cfb7a714d1d4ca0868241f69b31d44c51e55 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Thu, 27 Nov 2003 07:45:25 +0100 Subject: [PATCH] re PR rtl-optimization/13041 (linux-2.6/sound/core/oss/rate.c miscompiled) 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 | 7 +++++++ gcc/final.c | 4 ++-- gcc/reload1.c | 8 ++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 419e698e57c..95510a02fef 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2003-11-27 Eric Botcazou + + 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 PR target/12900 diff --git a/gcc/final.c b/gcc/final.c index f8750e98872..fe3ff6eeff4 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -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; diff --git a/gcc/reload1.c b/gcc/reload1.c index 22c03421a01..64dc0be4bf4 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -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; }