This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Fix PR 43562 -- 2nd try (was Re: [RFC] Fix PR 43562)


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.


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,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int __attribute__((ms_abi)) ACMStream_fnRead(int*iface,int start,int
+samples,int buffer){}
+typedef struct _IAVIStreamImpl {
+  int sInfo;
+  int has;
+} IAVIStreamImpl;
+extern int __attribute__((ms_abi)) aso(void*);
+int AVIFILE_OpenCompressor(IAVIStreamImpl *This)
+{
+  if (This->has != 0)
+  aso(&This->has);
+  sre(&This->sInfo);
+}
+
Index: reginfo.c
===================================================================
--- reginfo.c	(revision 158173)
+++ 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 ();
 }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]