This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Do not compare TYPE_MODE in operand_equal_p when OEP_ADDRESS_OF is set
- From: Richard Biener <rguenther at suse dot de>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 23 Oct 2015 10:05:50 +0200 (CEST)
- Subject: Re: Do not compare TYPE_MODE in operand_equal_p when OEP_ADDRESS_OF is set
- Authentication-results: sourceware.org; auth=none
- References: <20151023051105 dot GA71152 at kam dot mff dot cuni dot cz>
On Fri, 23 Oct 2015, Jan Hubicka wrote:
> Hi,
> this patch disables TYPE_MODE comparing when we care about address only.
> I already disabled other matching of types, but missed this one as it is
> placed later in the function body.
>
> Bootstrapped/regtested x86_64-linux, OK?
Ok.
Richard.
> Honza
>
> * fold-const.c (operand_equal_p): Do not compare TYPE_MODE when
> only address matters.
> Index: fold-const.c
> ===================================================================
> --- fold-const.c (revision 229153)
> +++ fold-const.c (working copy)
> @@ -2809,11 +2809,12 @@ operand_equal_p (const_tree arg0, const_
> return 0;
> }
>
> - /* This is needed for conversions and for COMPONENT_REF.
> - Might as well play it safe and always test this. */
> + /* When not checking adddresses, this is needed for conversions and for
> + COMPONENT_REF. Might as well play it safe and always test this. */
> if (TREE_CODE (TREE_TYPE (arg0)) == 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;
>
> /* If ARG0 and ARG1 are the same SAVE_EXPR, they are necessarily equal.
>
>
--
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)