From: Jan Hubicka <hubicka@ucw.cz>
To: gcc-patches@gcc.gnu.org, rguenther@suse.de
Subject: Handle CONSTRUCTOR in operand_equal_p
Date: Wed, 14 Oct 2015 16:27:00 -0000 [thread overview]
Message-ID: <20151014162702.GD16672@kam.mff.cuni.cz> (raw)
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;
}
next reply other threads:[~2015-10-14 16:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-14 16:27 Jan Hubicka [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151014162702.GD16672@kam.mff.cuni.cz \
--to=hubicka@ucw.cz \
--cc=gcc-patches@gcc.gnu.org \
--cc=rguenther@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).