public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Handle CONSTRUCTOR in operand_equal_p
@ 2015-10-14 16:27 Jan Hubicka
  2015-10-14 17:26 ` Jeff Law
  2015-10-14 18:42 ` Richard Biener
  0 siblings, 2 replies; 9+ messages in thread
From: Jan Hubicka @ 2015-10-14 16:27 UTC (permalink / raw)
  To: gcc-patches, rguenther

Hi,
this patch adds the CONSTRUCTOR case discussed while back.  Only empty
constructors are matched, as those are only appearing in gimple operand.
I tested that during bootstrap about 7500 matches are for empty ctors.
There are couple hundred for non-empty probably used on generic. 

Bootstrapped/regtested x86_64-linux, OK?

Honza

	* fold-const.c (operand_equal_p): Match empty constructors.
Index: fold-const.c
===================================================================
--- fold-const.c	(revision 228735)
+++ fold-const.c	(working copy)
@@ -2890,6 +2891,11 @@ operand_equal_p (const_tree arg0, const_
 	return operand_equal_p (TREE_OPERAND (arg0, 0), TREE_OPERAND (arg1, 0),
 				flags | OEP_ADDRESS_OF
 				| OEP_CONSTANT_ADDRESS_OF);
+      case CONSTRUCTOR:
+	/* In GIMPLE empty constructors are allowed in initializers of
+	   vector types.  */
+	return (!vec_safe_length (CONSTRUCTOR_ELTS (arg0))
+		&& !vec_safe_length (CONSTRUCTOR_ELTS (arg1)));
       default:
 	break;
       }

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

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

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-14 16:27 Handle CONSTRUCTOR in operand_equal_p Jan Hubicka
2015-10-14 17:26 ` Jeff Law
2015-10-14 17:35   ` Jan Hubicka
2015-10-14 18:42 ` Richard Biener
2015-10-14 23:55   ` Jan Hubicka
2015-10-15  6:57     ` Richard Biener
2015-10-21 19:10       ` Jan Hubicka
2015-10-22  7:39         ` Richard Biener
2015-10-23  5:43           ` Jan Hubicka

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).