Skip to content
Snippets Groups Projects
Commit fba05d9e authored by Richard Sandiford's avatar Richard Sandiford Committed by Richard Sandiford
Browse files

match.pd handling of three-constant bitops


natch.pd tries to reassociate two bit operations if both of them have
constant operands.  However, with the polynomial integers added later,
there's no guarantee that a bit operation on two integers can be folded
at compile time.  This means that the pattern can trigger for operations
on three constants, and as things stood could endlessly oscillate
between the two associations.

This patch keeps the existing pattern for the normal case of a
non-constant first operand.  When all three operands are constant it
tries to find a pair of constants that do fold.  If none do, it keeps
the original expression as-was.

2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
	    Alan Hayward  <alan.hayward@arm.com>
	    David Sherwood  <david.sherwood@arm.com>

gcc/
	* match.pd: Handle bit operations involving three constants
	and try to fold one pair.

Co-Authored-By: default avatarAlan Hayward <alan.hayward@arm.com>
Co-Authored-By: default avatarDavid Sherwood <david.sherwood@arm.com>

From-SVN: r256125
parent 0f26839a
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment