public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Jan Hubicka <hubicka@ucw.cz>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: Drop CONSTRUCTOR comparsion from ipa-icf-gimple
Date: Fri, 16 Oct 2015 08:48:00 -0000	[thread overview]
Message-ID: <CAFiYyc1ZsKWyLzGWTBqRrtH4NOw6w6cs1AA1Oz_vACqAytmcbw@mail.gmail.com> (raw)
In-Reply-To: <20151016031234.GC45365@kam.mff.cuni.cz>

On Fri, Oct 16, 2015 at 5:12 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
> Hi,
> as Richard noticed in my port of the code to operand_equal_p, the checking of
> CONSTURCTOR in ipa-icf-gimple is incomplete missing the index checks.
> It is also unnecesary since non-empty ctors does not happen as gimple
> operands.  This patch thus removes the unnecesary code.

Err - they do happen, for vector constructors.  Just empty constructors
are not allowed for vector constructors - vector constructors are required
to have elements in proper order and none left out.

Sorry for misleading you.

> Bootstrapped/regtested x86_64-linux, comitted.

this will definitely ICE ...

Richard.

> Honza
>
>         * ipa-icf-gimple.c (func_checker::compare_operand): Compare only
>         empty constructors.
> Index: ipa-icf-gimple.c
> ===================================================================
> --- ipa-icf-gimple.c    (revision 228851)
> +++ ipa-icf-gimple.c    (working copy)
> @@ -415,20 +415,9 @@ func_checker::compare_operand (tree t1,
>    switch (TREE_CODE (t1))
>      {
>      case CONSTRUCTOR:
> -      {
> -       unsigned length1 = vec_safe_length (CONSTRUCTOR_ELTS (t1));
> -       unsigned length2 = vec_safe_length (CONSTRUCTOR_ELTS (t2));
> -
> -       if (length1 != length2)
> -         return return_false ();
> -
> -       for (unsigned i = 0; i < length1; i++)
> -         if (!compare_operand (CONSTRUCTOR_ELT (t1, i)->value,
> -                               CONSTRUCTOR_ELT (t2, i)->value))
> -           return return_false();
> -
> -       return true;
> -      }
> +      gcc_assert (!vec_safe_length (CONSTRUCTOR_ELTS (t1))
> +                 && !vec_safe_length (CONSTRUCTOR_ELTS (t2)));
> +      return true;
>      case ARRAY_REF:
>      case ARRAY_RANGE_REF:
>        /* First argument is the array, second is the index.  */

  reply	other threads:[~2015-10-16  8:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-16  3:12 Jan Hubicka
2015-10-16  8:48 ` Richard Biener [this message]
2015-10-16 10:54   ` H.J. Lu
2015-10-16 10:55     ` 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=CAFiYyc1ZsKWyLzGWTBqRrtH4NOw6w6cs1AA1Oz_vACqAytmcbw@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    /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).