Commit addf8634 by Jan Hubicka Committed by Jan Hubicka

fold-const.c (operand_equal_p): Do not compare TYPE_MODE when comparing addresses.

	* fold-const.c (operand_equal_p): Do not compare TYPE_MODE when
	comparing addresses.

From-SVN: r229265
parent 980002c6
2015-10-23 Jan Hubicka <hubicka@ucw.cz> 2015-10-23 Jan Hubicka <hubicka@ucw.cz>
* fold-const.c (operand_equal_p): Do not compare TYPE_MODE when
comparing addresses.
2015-10-23 Jan Hubicka <hubicka@ucw.cz>
* fold-const.c (operand_equal_p): Handle matching of vector * fold-const.c (operand_equal_p): Handle matching of vector
constructors. constructors.
...@@ -2809,11 +2809,12 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags) ...@@ -2809,11 +2809,12 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags)
return 0; return 0;
} }
/* This is needed for conversions and for COMPONENT_REF. /* When not checking adddresses, this is needed for conversions and for
Might as well play it safe and always test this. */ COMPONENT_REF. Might as well play it safe and always test this. */
if (TREE_CODE (TREE_TYPE (arg0)) == ERROR_MARK if (TREE_CODE (TREE_TYPE (arg0)) == ERROR_MARK
|| TREE_CODE (TREE_TYPE (arg1)) == ERROR_MARK || TREE_CODE (TREE_TYPE (arg1)) == ERROR_MARK
|| TYPE_MODE (TREE_TYPE (arg0)) != TYPE_MODE (TREE_TYPE (arg1))) || (TYPE_MODE (TREE_TYPE (arg0)) != TYPE_MODE (TREE_TYPE (arg1))
&& !(flags & OEP_ADDRESS_OF)))
return 0; return 0;
/* If ARG0 and ARG1 are the same SAVE_EXPR, they are necessarily equal. /* If ARG0 and ARG1 are the same SAVE_EXPR, they are necessarily equal.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment