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]
Other format: [Raw text]

[PATCH RS6000] Fix invalid string instruction


Hi,
  The rs6000 back-end can in some cases produce a load string
instruction where the address of the load would conflict with the
destination.  These are invalid instructions on PowerPC and will cause
a trap.  The issue is that one of the clobbers is a match_operand with
a constraint for just setting the register but the register allocator
assumes that it could use one of the input registers (memory address)
containing in there.  This is not true so marking the match_operand's
constraint as an early clobber fixes the problem.

I don't have a testcase that I could add to the testsuite as the code
where this issue was found is proprietary and I can't figure out how
to make a good testcase for this case without knowing the register
allocator better.

OK? Bootstrapped and tested on powerpc64-linux-gnu with no regressions.

Thanks,
Andrew Pinski

PS this has been a bug since 1995 when Kenner rewrote this memcpy patterns.

ChangeLog:

* config/rs6000/rs6000.md: Change all string instruction's clobber to be
early clobbers.

Attachment: fixstring.diff.txt
Description: Text document


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