public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Do not compare TYPE_MODE in operand_equal_p when OEP_ADDRESS_OF is set
@ 2015-10-23  5:19 Jan Hubicka
  2015-10-23  8:08 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Hubicka @ 2015-10-23  5:19 UTC (permalink / raw)
  To: gcc-patches, rguenther

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?

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Do not compare TYPE_MODE in operand_equal_p when OEP_ADDRESS_OF is set
  2015-10-23  5:19 Do not compare TYPE_MODE in operand_equal_p when OEP_ADDRESS_OF is set Jan Hubicka
@ 2015-10-23  8:08 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2015-10-23  8:08 UTC (permalink / raw)
  To: Jan Hubicka; +Cc: gcc-patches

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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-23  8:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-23  5:19 Do not compare TYPE_MODE in operand_equal_p when OEP_ADDRESS_OF is set Jan Hubicka
2015-10-23  8:08 ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).