]> git.ipfire.org Git - thirdparty/gcc.git/commit
rtl: Enable the use of rtx values with int and mode attributes
authorAndre Vieira <andre.simoesdiasvieira@arm.com>
Mon, 19 Aug 2024 08:38:41 +0000 (09:38 +0100)
committerAndre Vieira <andre.simoesdiasvieira@arm.com>
Mon, 19 Aug 2024 08:46:11 +0000 (09:46 +0100)
commite57d3cce4e4fdf50fa59b807ea43c8b14c5c1711
tree35b884184ad1232dd56ced485354763f47ec71e7
parent71059d268f567b664e74101c8be7b58441f15d29
rtl: Enable the use of rtx values with int and mode attributes

The 'code' part of a 'define_code_attr' refers to the type of the key, in other
words, it uses a code_iterator to pick the 'value' from their (key "value") pair
list.

However, rtx_alloc_for_name requires a code_attribute to be used when the
'value' needs to be a type. In other words, no other type of attributes could be
used, before this patch, to produce a rtx typed 'value'.

This patch removes that restriction and allows the backend to use any kind of
attribute as long as that attribute always produces a valid code typed 'value'.

gcc/ChangeLog:

* read-rtl.cc (rtx_reader::rtx_alloc_for_name): Allow all attribute
types to produce code 'values'.
(check_code_attribute): Rename ...
(check_attribute_codes): ... to this.  And change comments to refer to
* doc/md.texi: Add paragraph to document that you can use int and mode
attributes to produce codes.
gcc/doc/md.texi
gcc/read-rtl.cc