gensupport: Fix define_subst operand renumbering.
authorkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Mar 2016 09:19:14 +0000 (09:19 +0000)
committerkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Mar 2016 09:19:14 +0000 (09:19 +0000)
commitbb114830ceeb45a9684f35440052e88961f08c0f
tree40fa4d5a3c60cf562ed26ab6cf2d20746bff3dbb
parent40a35c55e5492c5124f7bfa14ad0fd15e6d6d430
gensupport: Fix define_subst operand renumbering.

When processing substitutions the operands are renumbered.  To find a
free operand number the array used_operands_numbers is used.
Currently this array is used to assign new numbers before all the
RTXes in the vector have been processed.  I did run into problems with
this for insns where a match_dup occurred in a later (use ...) operand
referring to an earlier operand (e.g. s390.md "setmem_long").

The patch splits the loop doing the processing into two in order to
have all the operand numbers collected already when assigning new
numbers.

gcc/ChangeLog:

2016-03-01  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* gensupport.c (process_substs_on_one_elem): Split loop to
complete mark_operands_used_in_match_dup on all expressions in the
vector first.
(adjust_operands_numbers): Inline into process_substs_on_one_elem
and remove function.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233841 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/gensupport.c