mismatched parentheses in reload1.c

Paolo Bonzini paolo.bonzini@lu.unisi.ch
Mon Aug 21 17:07:00 GMT 2006


This patch:

------------------------------------------------------------------------
r116277 | hubicka | 2006-08-21 02:00:14 +0200 (Mon, 21 Aug 2006) | 6 lines

         PR rtl-optimization/28071
         * reload1.c (reg_has_output_reload): Turn into regset.
         (reload_as_needed, forget_old_reloads_1, forget_marked_reloads,
         choose_reload_regs, emit_reload_insns): Update to new
         reg_has_output_reload.

------------------------------------------------------------------------

introduced changes in these lines of code (around line 7390 of reload1.c):

   else if (rld[r].out_reg == 0
            && rld[r].in != 0
            && ((REG_P (rld[r].in)
                 && REGNO (rld[r].in) >= FIRST_PSEUDO_REGISTER
                 && !REGNO_REG_SET_P (&reg_has_output_reload,
                                      REGNO (rld[r].in))
                || (REG_P (rld[r].in_reg)
                    && !REGNO_REG_SET_P (&reg_has_output_reload,
                                         REGNO (rld[r].in)))))
            && ! reg_set_p (rld[r].reg_rtx, PATTERN (insn)))

Notice how the OR is aligned with the parentheses, but in fact the 
closing parentheses on the previous line do *not* close up to the REG_P 
(only up to the REGNO_REG_SET_P).  I think something like this patch 
would be necessary:

                 && !REGNO_REG_SET_P (&reg_has_output_reload,
-                                    REGNO (rld[r].in))
+                                    REGNO (rld[r].in)))
                || (REG_P (rld[r].in_reg)
                    && !REGNO_REG_SET_P (&reg_has_output_reload,
-                                       REGNO (rld[r].in)))))
+                                       REGNO (rld[r].in))))


Honza, do you agree?

Paolo



More information about the Gcc mailing list