[Bug rtl-optimization/16028] Bad code gen for vector code with -O3 (caused by GRA/reload)

ebotcazou at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Jun 17 07:46:00 GMT 2004


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2004-06-17 07:46 -------
> Yes, senarios are similar. I will try the patch you mentioned and see how it
> goes.

Thanks for the confirmation.  Hopefully with now two incarnations of the
problem, we'll able to come up with a solution.

Unfortunately, as pointed out by Joern
   http://gcc.gnu.org/ml/gcc-patches/2004-06/msg00061.html
my patch is wrong because it effectively disables inheritance (sorry for not
giving the link earlier, I didn't remember it wasn't reachable from the original
message).

As you can see, how reload inheritance is supposed to work is a little unclear.
 Its failure mode may be problematic or not.  I think a correct patch could be:

Index: reload1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload1.c,v
retrieving revision 1.436
diff -u -p -r1.436 reload1.c
--- reload1.c   20 May 2004 11:45:20 -0000      1.436
+++ reload1.c   17 Jun 2004 07:34:57 -0000
@@ -5654,10 +5654,9 @@ choose_reload_regs (struct insn_chain *c
                                                           i);
                    }

-                 if ((regs_used
-                      && ! free_for_value_p (regno, rld[r].mode,
-                                             rld[r].opnum, rld[r].when_needed,
-                                             rld[r].in, rld[r].out, r, 1))
+                 if (! free_for_value_p (regno, rld[r].mode,
+                                         rld[r].opnum, rld[r].when_needed,
+                                         rld[r].in, rld[r].out, r, 1)
                      || bad_for_class)
                    equiv = 0;
                }


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16028



More information about the Gcc-bugs mailing list