This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: mismatched parentheses in reload1.c
- From: Jan Hubicka <jh at suse dot cz>
- To: Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>
- Cc: GCC Development <gcc at gcc dot gnu dot org>, Jan Hubicka <jh at suse dot cz>
- Date: Mon, 21 Aug 2006 19:07:36 +0200
- Subject: Re: mismatched parentheses in reload1.c
- References: <44E9C37E.3080904@lu.unisi.ch>
> 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 (®_has_output_reload,
> REGNO (rld[r].in))
> || (REG_P (rld[r].in_reg)
> && !REGNO_REG_SET_P (®_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 (®_has_output_reload,
> - REGNO (rld[r].in))
> + REGNO (rld[r].in)))
> || (REG_P (rld[r].in_reg)
> && !REGNO_REG_SET_P (®_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