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 (x86): PR 18019 (again)


The fix to the movqi_1 pattern, recorded in the PR, does not fix the entire problem.
When the destination reg is EDI/ESI, and -Os is used, the current pattern produces
a 'movl', which is wrong. See attached testcase. This patch does the following.


- Removes the 'q' from case 5 (?r, qm), as case 3 (r, q) will handle that pairing.
- Adds a ? to case 3, as we prefer q to r for source when available.
- Adjusts the "type" computation so case 5 (?r, m) always uses movzbl. We never
want to get into the choice between movq and movl in this case, as movq is not valid
for an r destination and movl is not valid for an m source (as the word load might
cross a page boundary).


Bootstrapped and tested, x86 darwin. OK?

2005-06-07 Dale Johannesen <dalej@apple.com>

        * config/i386/i386.md (movqi_1):  Fix case where source
        is memory and destination EDI.

2005-06-07 Dale Johannesen <dalej@apple.com>

* gcc.target/i386/movq.c: New.

Attachment: diffs3.txt
Description: Text document

Attachment: movq.c
Description: Text document



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