This is the mail archive of the gcc-patches@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]

Re: MIPS patch: fix incorrectly inverted branch


  In message <wvnelsc60nd.fsf@talisman.cambridge.redhat.com>you write:
  > 
  > Testcase: attached
  > Target: mips64-elf -mips3
  > 
  > This patch fixes a problem with gen_int_relational's handling of X != 0
  > comparisons, where X is not a register.  When called by branch-generating
  > functions, gen_int_relational is passed a pointer to a boolean flag that
  > gets set if the branch should be reversed.  In the case of X != 0,
  > gen_int_relational first assumes it will generate an inverted condition, an
  > d
  > that a reversed branch is therefore needed.  It later realises it can creat
  > e
  > a non-inverted condition after all, but doesn't change its decision to
  > reverse the branch.  In the test case below, the "then" and "else" clauses
  > are effectively reversed.
  > 
  > Patch was tested on a i686-linux-gnu-x-mips64-elf toolchain with -mips3.
  > Fixes the test case below & introduces no regressions.
  > 
  > 
  > 2001-06-22  Richard Sandiford  <rsandifo@redhat.com>
  > 
  > 	* config/mips/mips.c (gen_int_relational): Tell the caller not to
  > 	reverse a branch if a NE comparison is implemented with GTU.
I have a slight preference to avoid the unnecessary "else" like Richard.
But as you say, either way should work.

Approved.  Please install (either with or without the unnecessary else).

Also install your testcase into the regression testsuite in the
testsuite/gcc.c-torture/execute directory.

Thanks for your patience.

jeff


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