Bug in gcse note hacks, bootstrap

Jan Hubicka hubicka@atrey.karlin.mff.cuni.cz
Tue Dec 21 07:05:00 GMT 1999


Hi
First of all, I am sorry for breaking the tree. This problem didn't showed up on
bootstrap at atrey, because gcse is mostly impotent on i386, because of the
PARALLEL insns introduced by new backend, so I didn't notice that.
Per probably got error because he uses other -mcpu= switch. i686 uses less
PARALLELs than i586. Sorry.
Also if you read my original email about this patch, it notes, that I am
unsure about this area.

I am following the protocol very carefully and most of my patches bootstrap
twice, once before they are sent to the list and oce before they are installed.

Same apply to the regclass change too and I am not aware of any lossage I made
to tree by my other changes.

The only fix I was able to come with was to completly disable to REG_EQUIV
notes handling code in gcse. I can't do more without having platform to
actually test the bug.
Can please someone sumarize for me the invariants for REG_EQUIV notes
required for reload?

Here is the patch. Note that I probably will not read the email next few days,
so please install it if it does fix the problem.
Thanks

Honza


Tue Dec 21 15:43:57 MET 1999  Jan Hubicka  <hubicka@freesoft.cz>
	* gcse.c (try_replace_reg): Do not modify the REG_EQUIV notes to
	keep reload happy.

Index: egcs/gcc/gcse.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/gcse.c,v
retrieving revision 1.73
diff -c -3 -p -r1.73 gcse.c
*** gcse.c	1999/12/17 11:10:58	1.73
--- gcse.c	1999/12/21 14:37:46
*************** try_replace_reg (from, to, insn)
*** 3709,3717 ****
  
    note = find_reg_note (insn, REG_EQUAL, NULL_RTX);
  
-   if (!note)
-     note = find_reg_note (insn, REG_EQUIV, NULL_RTX);
- 
    /* If this fails we could try to simplify the result of the
       replacement and attempt to recognize the simplified insn.
  
--- 3709,3714 ----
*************** try_replace_reg (from, to, insn)
*** 3721,3726 ****
--- 3718,3732 ----
  
    success = validate_replace_src (from, to, insn);
    set = single_set (insn);
+ 
+   /* We can't handle REG_EQUIV notes in the same way as REG_EQUAL notes,
+      because reload is unhappy about seeing REG_EQUIV notes other than
+      memory or constants.  So don't do anything when REG_EQUIV note is
+      present.
+      ??? Is it correct for insn to have both REG_EQUIV and REG_EQUAL note?
+   */
+   if (!note && find_reg_note (insn, REG_EQUIV, NULL_RTX))
+     return success;
  
    /* We've failed to do replacement. Try to add REG_EQUAL note to not loose
       information.  */


More information about the Gcc-patches mailing list