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: mismatched parentheses in reload1.c


> 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?

Yes, thanks for noticing the problem and my apologizes for the screwup.  The
conditionals are easy to misread :(

Honza


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