From: Kazu Hirata Date: Fri, 28 Mar 2003 15:18:11 +0000 (+0000) Subject: re PR target/10205 (Incorrect code generated for H8300 "normal" mode) X-Git-Tag: releases/gcc-3.4.0~7621 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d18ad19175a1a54aa79cdfad88c65019cbc0f4ae;p=thirdparty%2Fgcc.git re PR target/10205 (Incorrect code generated for H8300 "normal" mode) PR target/10205 * config/h8300/h8300.c (h8300_initial_elimination_offset): Correct the offset computation when TARGET_NORMAL. Co-Authored-By: Dhananjay R. Deshpande From-SVN: r64975 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 581d7588aff9..c4d4d6bc9fad 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2003-03-28 Kazu Hirata , + Dhananjay Deshpande + + PR target/10205 + * config/h8300/h8300.c (h8300_initial_elimination_offset): + Correct the offset computation when TARGET_NORMAL. + 2003-03-28 Eric Botcazou PR target/10067 diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index 191bccc27711..cfbb9590ea52 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -1715,9 +1715,11 @@ h8300_initial_elimination_offset (from, to) int from, to; { int offset = 0; + /* The number of bytes that the return address takes on the stack. */ + int pc_size = POINTER_SIZE / BITS_PER_UNIT; if (from == ARG_POINTER_REGNUM && to == FRAME_POINTER_REGNUM) - offset = UNITS_PER_WORD + frame_pointer_needed * UNITS_PER_WORD; + offset = pc_size + frame_pointer_needed * UNITS_PER_WORD; else if (from == RETURN_ADDRESS_POINTER_REGNUM && to == FRAME_POINTER_REGNUM) offset = frame_pointer_needed * UNITS_PER_WORD; else @@ -1734,12 +1736,10 @@ h8300_initial_elimination_offset (from, to) offset += round_frame_size (get_frame_size ()); if (from == ARG_POINTER_REGNUM && to == STACK_POINTER_REGNUM) - offset += UNITS_PER_WORD; /* Skip saved PC */ + /* Skip saved PC. */ + offset += pc_size; } - if ((TARGET_H8300H || TARGET_H8300S) && TARGET_NORMAL_MODE) - offset -= 2; - return offset; }