This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix buglet in previous mechanical loop.c change
- From: Daniel Jacobowitz <drow at false dot org>
- To: Jeffrey A Law <law at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 15 Jul 2004 11:11:46 -0400
- Subject: Re: Fix buglet in previous mechanical loop.c change
- References: <1089903300.5186.505.camel@speedy>
On Thu, Jul 15, 2004 at 08:55:01AM -0600, Jeffrey A Law wrote:
> The recent change to use various predicates instead of explicitly
> testing for suitable rtx codes had a minor flaw. Consider this
> change fragment from loop.c:
>
> ! if (GET_CODE (p) == INSN || GET_CODE (p) == JUMP_INSN
> ! || GET_CODE (p) == CODE_LABEL)
> ! if (INSN_P (p))
> In particular note that we no longer call update_giv_derive if P is a
> CODE_LABEL.
>
> This can cause the loop optimizer to incorrectly reduce a GIV when it's
> BIV is conditionally incremented.
And you changed this to:
> ! if (INSN_P (p) || LABEL_P (p))
This now accepts CALL_INSN, which it didn't used to. Was that a bug in
the old code?
--
Daniel Jacobowitz