public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: Richard Earnshaw <rearnsha@arm.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: Re: target/5828: gcc-3.0.4 on arm : floating point registers incorrectly reloaded Date: Thu, 14 Mar 2002 07:16:00 -0000 [thread overview] Message-ID: <20020314151604.6865.qmail@sources.redhat.com> (raw) The following reply was made to PR target/5828; it has been noted by GNATS. From: Richard Earnshaw <rearnsha@arm.com> To: jeroen dobbelaere <jeroen.dobbelaere@acunia.com> Cc: gcc-patches@gcc.gnu.org, gcc-gnats@gcc.gnu.org, Richard.Earnshaw@arm.com Subject: Re: target/5828: gcc-3.0.4 on arm : floating point registers incorrectly reloaded Date: Thu, 14 Mar 2002 15:13:28 +0000 This is a multipart MIME message. --==_Exmh_-16759862300 Content-Type: text/plain; charset=us-ascii Richard Earnshaw wrote: > + 2002-03-04 Jeroen Dobbelaere <jeroen.dobbelaere@acunia.com> > + > + * config/arm/arm.c (arm_output_epilogue): bug 5828 : offset > + must start at 0 in stead of 12. > + > > This patch is incorrect. [...] > 2) It is cludge to work around another bug further down the function. Having thought about this some more, I've revised my opinion. This a slightly different, but equally valid, way of looking at the problem. However, it slightly confuses the way the offsets are being calculated. I've committed the following patch to correct the problem: 2002-03-14 Richard Earnshaw <rearnsha@arm.com> Jeroen Dobbelaere <jeroen.dobbelaere@acunia.com> PR target/5828 * arm.c (arm_output_epilogue): Fix floating-point register save adjustment when using a frame pointer. --==_Exmh_-16759862300 Content-Type: text/x-patch ; name="gcc-armfpsave.patch"; charset=us-ascii Content-Description: gcc-armfpsave.patch Content-Disposition: attachment; filename="gcc-armfpsave.patch" Index: arm.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.c,v retrieving revision 1.197 diff -p -r1.197 arm.c *** arm.c 2002/03/13 05:42:33 1.197 --- arm.c 2002/03/14 15:03:26 *************** arm_output_epilogue (really_return) *** 7467,7474 **** int reg; unsigned long saved_regs_mask; unsigned long func_type; ! /* If we need this, then it will always be at least this much. */ ! int floats_offset = 12; rtx operands[3]; int frame_size = get_frame_size (); FILE * f = asm_out_file; --- 7467,7475 ---- int reg; unsigned long saved_regs_mask; unsigned long func_type; ! /* Floats_offset is the offset from the "virtual" frame. In an APCS ! frame that is $fp + 4 for a non-variadic function. */ ! int floats_offset = 0; rtx operands[3]; int frame_size = get_frame_size (); FILE * f = asm_out_file; *************** arm_output_epilogue (really_return) *** 7505,7510 **** --- 7506,7514 ---- saved_regs_mask = arm_compute_save_reg_mask (); + /* XXX We should adjust floats_offset for any anonymous args, and then + re-adjust vfp_offset below to compensate. */ + /* Compute how far away the floats will be. */ for (reg = 0; reg <= LAST_ARM_REGNUM; reg ++) if (saved_regs_mask & (1 << reg)) *************** arm_output_epilogue (really_return) *** 7512,7517 **** --- 7516,7523 ---- if (frame_pointer_needed) { + int vfp_offset = 4; + if (arm_fpu_arch == FP_SOFT2) { for (reg = LAST_ARM_FP_REGNUM; reg >= FIRST_ARM_FP_REGNUM; reg--) *************** arm_output_epilogue (really_return) *** 7519,7525 **** { floats_offset += 12; asm_fprintf (f, "\tldfe\t%r, [%r, #-%d]\n", ! reg, FP_REGNUM, floats_offset); } } else --- 7525,7531 ---- { floats_offset += 12; asm_fprintf (f, "\tldfe\t%r, [%r, #-%d]\n", ! reg, FP_REGNUM, floats_offset - vfp_offset); } } else *************** arm_output_epilogue (really_return) *** 7536,7542 **** if (start_reg - reg == 3) { asm_fprintf (f, "\tlfm\t%r, 4, [%r, #-%d]\n", ! reg, FP_REGNUM, floats_offset); start_reg = reg - 1; } } --- 7542,7548 ---- if (start_reg - reg == 3) { asm_fprintf (f, "\tlfm\t%r, 4, [%r, #-%d]\n", ! reg, FP_REGNUM, floats_offset - vfp_offset); start_reg = reg - 1; } } *************** arm_output_epilogue (really_return) *** 7545,7551 **** if (reg != start_reg) asm_fprintf (f, "\tlfm\t%r, %d, [%r, #-%d]\n", reg + 1, start_reg - reg, ! FP_REGNUM, floats_offset); start_reg = reg - 1; } } --- 7551,7557 ---- if (reg != start_reg) asm_fprintf (f, "\tlfm\t%r, %d, [%r, #-%d]\n", reg + 1, start_reg - reg, ! FP_REGNUM, floats_offset - vfp_offset); start_reg = reg - 1; } } *************** arm_output_epilogue (really_return) *** 7554,7560 **** if (reg != start_reg) asm_fprintf (f, "\tlfm\t%r, %d, [%r, #-%d]\n", reg + 1, start_reg - reg, ! FP_REGNUM, floats_offset); } /* saved_regs_mask should contain the IP, which at the time of stack --- 7560,7566 ---- if (reg != start_reg) asm_fprintf (f, "\tlfm\t%r, %d, [%r, #-%d]\n", reg + 1, start_reg - reg, ! FP_REGNUM, floats_offset - vfp_offset); } /* saved_regs_mask should contain the IP, which at the time of stack --==_Exmh_-16759862300--
next reply other threads:[~2002-03-14 15:16 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-03-14 7:16 Richard Earnshaw [this message] -- strict thread matches above, loose matches on Subject: below -- 2002-03-14 7:54 rearnsha 2002-03-06 3:46 jeroen dobbelaere 2002-03-06 2:36 Richard Earnshaw 2002-03-05 2:56 jeroen dobbelaere 2002-03-05 2:56 jeroen dobbelaere 2002-03-04 7:06 jeroen.dobbelaere
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20020314151604.6865.qmail@sources.redhat.com \ --to=rearnsha@arm.com \ --cc=gcc-prs@gcc.gnu.org \ --cc=nobody@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).