r230485 - in /trunk/gcc: ChangeLog doc/match-an...

rsandifo@gcc.gnu.org rsandifo@gcc.gnu.org
Tue Nov 17 18:48:00 GMT 2015


Author: rsandifo
Date: Tue Nov 17 18:48:23 2015
New Revision: 230485

URL: https://gcc.gnu.org/viewcvs?rev=230485&root=gcc&view=rev
Log:
Add null identifiers to genmatch

This patch adds a null identifier that can never match anything and
can never be generated.  It is only valid in operator lists and fors.
Later patches will add uses of it.

The idea is to allow operator lists for maths functions that have
four entries:

- float built-in
- double built-in
- long double built-in
- internal function

Not all maths functions have an associated internal function,
and for those the final operator will be "null".  Any simplification
that tries to use a null substitution will be skipped.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
	* doc/match-and-simplify.texi: Document the "null" identifier.
	* genmatch.c (id_base::NULL_ID): New kind.
	(null_id): New variable.
	(get_operator): Add a parameter that says whether null identifiers
	are allowed.
	(contains_id): New function.
	(lower_for): Skip substitutions that would have a null_id in
	either the match or the result.
	(parser::parse_for): Allow the null identifier to be used.
	(parser::parse_operator_list): Likewise.
	(main): Initialize null_id.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/doc/match-and-simplify.texi
    trunk/gcc/genmatch.c



More information about the Gcc-cvs mailing list