]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix arc assumption that insns are not re-recognized
authorJeff Law <jlaw@ventanamicro.com>
Sun, 18 Jun 2023 17:25:12 +0000 (11:25 -0600)
committerJeff Law <jlaw@ventanamicro.com>
Sun, 18 Jun 2023 17:25:12 +0000 (11:25 -0600)
commit0f9bb3e7a4aab95fd449f60b5f891ed9a6e5f352
treed3673dcb0e85a707a85d3948032e567a6e9bb3e2
parent5a1ef1cfac005370d0a5a0f85798724cb2c9cf5e
Fix arc assumption that insns are not re-recognized

Testing the V2 version of Manolis's fold-mem-offsets patch exposed a minor bug
in the arc backend.

The movsf_insn pattern has constraints which allow storing certain constants
to memory.  reload/lra will target those alternatives under the right
circumstances.  However the insn's condition requires that one of the two
operands must be a register.

Thus if a pass were to force re-recognition of the pattern we can get an
unrecognized insn failure.

This patch adjusts the conditions to more closely match movsi_insn.  More
specifically it allows storing a constant into a limited set of memory
operands (as defined by the Usc constraint).  movqi_insn has the same
core problem and gets the same solution.

Committed after the tester validated there are not regresisons

gcc/
* config/arc/arc.md (movqi_insn): Allow certain constants to
be stored into memory in the pattern's condition.
(movsf_insn): Similarly.
gcc/config/arc/arc.md