This is the mail archive of the gcc@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: Your change breaks MIPS.


On Sun, Dec 30, 2001 at 12:44:31AM +0100, Jan Hubicka wrote:
> >  > BTW, am I the only one seeing bootstrap failure on mips?
> >  > Thanks.
> >  > H.J.
> > 
> > No, I see it also on irix6.2.
> I got it now too.  I hoped the problem to be cc0 issue related to jump threading,
> but jump threading code appears to handle cc0 conservatively - in fact disable wast
> majority of threading - I need to fix that separately.
> 
> Does someone have simplified testcase or can reproduce similar breakage on other target?
> 

I am testing this patch on mips now. I don't know it will solve the
mips bootstrap problem. But Jan, I blieve you really meant

  cleanup_cfg ((optimize ? CLEANUP_EXPENSIVE : 0)
	       | (flag_thread_jumps ? CLEANUP_THREADING : 0));

Please note | has a higher precedence than ?:.


H.J.
---
2002-01-02  H.J. Lu <hjl@gnu.org>

	* cfgcleanup.c: Include "tm_p.h".
	(mark_effect): Handle hard registers.

	* toplev.c (rest_of_compilation): Fix a typo when calling
	cleanup_cfg.

--- gcc/cfgcleanup.c.bad	Wed Jan  2 13:54:51 2002
+++ gcc/cfgcleanup.c	Wed Jan  2 16:47:56 2002
@@ -43,6 +43,7 @@ Software Foundation, 59 Temple Place - S
 #include "recog.h"
 #include "toplev.h"
 #include "cselib.h"
+#include "tm_p.h"
 
 #include "obstack.h"
 
@@ -188,6 +189,8 @@ mark_effect (exp, nonequal)
   rtx exp;
   regset nonequal;
 {
+  int regno;
+
   switch (GET_CODE (exp))
     {
       /* In case we do clobber the register, mark it as equal, as we know the
@@ -201,7 +204,14 @@ mark_effect (exp, nonequal)
 	  return false;
 	if (GET_CODE (SET_SRC (exp)) != REG)
 	  return true;
-	SET_REGNO_REG_SET (nonequal, REGNO (SET_SRC (exp)));
+	regno = REGNO (SET_SRC (exp));
+	SET_REGNO_REG_SET (nonequal, regno);
+	if (regno < FIRST_PSEUDO_REGISTER)
+	  {
+	    int n = HARD_REGNO_NREGS (regno, GET_MODE (SET_SRC (exp)));
+	    while (--n > 0)
+	      SET_REGNO_REG_SET (nonequal, regno + n);
+	  }
 	return false;
       default:
 	return false;
--- gcc/toplev.c.bad	Fri Dec 28 22:26:35 2001
+++ gcc/toplev.c	Wed Jan  2 16:47:41 2002
@@ -2941,7 +2941,7 @@ rest_of_compilation (decl)
   open_dump_file (DFI_cfg, decl);
 
   find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
-  cleanup_cfg (optimize ? CLEANUP_EXPENSIVE : 0
+  cleanup_cfg ((optimize ? CLEANUP_EXPENSIVE : 0)
 	       | (flag_thread_jumps ? CLEANUP_THREADING : 0));
   check_function_return_warnings ();
 


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