On 08/19/2016 05:30 PM, Patrick Palka wrote:
integer_nonzerop() currently unconditionally returns false for a
VECTOR_CST argument. This is confusing because one would expect that
integer_onep(x) => integer_nonzerop(x) for all x but that is currently
not the case. For a VECTOR_CST of all ones i.e. {1,1,1,1},
integer_onep() returns true but integer_nonzerop() returns false.
This patch makes integer_nonzerop() handle VECTOR_CSTs in the obvious
way and also adds some self tests (the last of which fails without the
change). Does this look OK to commit afetr bootstrap + regtesting on
x86_64-pc-linux-gnu?
gcc/ChangeLog:
* tree.c (integer_nonzerop): Rewrite to use a switch. Handle
VECTOR_CSTs.
(test_vector_constants): New static function.
(tree_c_tests): Call it.
OK.
jeff