This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR 43662 (was Re: [RFC] Fix PR 43562 -- 2nd try (was Re: [RFC] Fix PR 43562))
- From: Jie Zhang <jie at codesourcery dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Jeff Law <law at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Jakub Jelinek <jakub at redhat dot com>
- Date: Mon, 19 Apr 2010 15:18:13 +0800
- Subject: [PATCH] Fix PR 43662 (was Re: [RFC] Fix PR 43562 -- 2nd try (was Re: [RFC] Fix PR 43562))
- References: <4BB02691.50406@codesourcery.com> <4BB0E7FF.70005@codesourcery.com> <4BB1786C.6030206@codesourcery.com> <4BB243CA.7000202@redhat.com> <4BB2B8F3.5010506@codesourcery.com> <x2y6dc9ffc81004090933jf6257526za20bc8de3e643957@mail.gmail.com> <4BBF82A7.4050907@codesourcery.com> <4BC098F1.7020408@codesourcery.com>
On 04/10/2010 11:27 PM, Jie Zhang wrote:
On 04/10/2010 03:40 AM, Jie Zhang wrote:
On 04/10/2010 12:33 AM, H.J. Lu wrote:
As you suggested, this patch moves call of init_caller_save to IRA
main
function. A flag "caller_save_initialized_p" is used to avoid
duplicate
initializations. When a reinitialization is need, that flag is
set to
false again such that caller-save will be initialized in the next
call
of init_caller_save. Testing is going on. Is it OK if no
regressions?
This caused:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43662
Thanks for reporting this. I'm testing this patch.
No regressions found on bootstrap and testsuite on native
x86_64-pc-linux-gnu.
This is an updated patch, which addressed the comments in bugzilla. I added
/* { dg-require-effective-target lp64 } */
to the test case as suggested by Mikael Pettersson. I also cleaned up
the test case a little.
Is it OK?
Jie
PR target/43662
* reginfo.c (reinit_regs): Set caller_save_initialized_p
to false.
testsuite/
* gcc.target/i386/pr43662.c: New test.
Index: testsuite/gcc.target/i386/pr43662.c
===================================================================
--- testsuite/gcc.target/i386/pr43662.c (revision 0)
+++ testsuite/gcc.target/i386/pr43662.c (revision 0)
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2" } */
+
+void __attribute__ ((ms_abi)) foo (void)
+{
+}
+
+typedef struct _IAVIStreamImpl
+{
+ int sInfo;
+ int has;
+} IAVIStreamImpl;
+
+extern int __attribute__ ((ms_abi)) aso (void *);
+extern int sre (void *);
+
+int AVIFILE_OpenCompressor (IAVIStreamImpl *This)
+{
+ if (This->has != 0)
+ aso (&This->has);
+ sre (&This->sInfo);
+ return 0;
+}
Index: reginfo.c
===================================================================
--- reginfo.c (revision 158502)
+++ reginfo.c (working copy)
@@ -666,6 +666,8 @@ void
reinit_regs (void)
{
init_regs ();
+ /* caller_save needs to be re-initialized. */
+ caller_save_initialized_p = false;
ira_init ();
}