On 2015-02-05 4:36 PM, sa...@hederstierna.com wrote:
Hi

When reviewing some code from LRA, I just saw some lines that looked a bit 
strange,
could it be a possible typo perhaps?

The file "lra.c" from GC5 master branch current date

Line 469:

              /* Try x = index_scale; x = x + disp; x = x + base.  */
              last = get_last_insn ();
              rtx_insn *move_insn = emit_move_insn (x, index_scale);
              ok_p = false;
              if (recog_memoized (move_insn) >= 0)
                {
                  rtx insn = emit_add2_insn (x, disp);
                  if (insn != NULL_RTX)
                    {
                      insn = emit_add2_insn (x, disp);
                      if (insn != NULL_RTX)
                        ok_p = true;
                    }
                }

Shouldn't the code be as the comment suggest to in the second call to 
emit_add2_insn use 'base' ?

-                     insn = emit_add2_insn (x, disp);
+                     insn = emit_add2_insn (x, base);

Maybe the code is right, I tried to mail vmakarov, some months ago, but did not 
get any reply.
But it looks like I typo, so I just wanted to verify it so its not a bug,


Sorry, Fredrik. I guess I overlooked your email. It is really a typo. I tried to consider all possible situations for all possible targets. Not all of them occurs or occurs extremely rarely, e.g. the current code to be run needs probably a lot of coincidences (a specific target and unusual equiv substitutions).

I'll commit this change today after testing as I remember you have no write access to GCC repository.

Thanks for reporting this again (sometimes we overlook emails as we have too many of them). And thanks for checking LRA code.

Reply via email to