public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hubicka at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ipa/65908] [5/6 Regression] ICE: in expand_thunk, at cgraphunit.c:1700
Date: Tue, 12 May 2015 19:44:00 -0000	[thread overview]
Message-ID: <bug-65908-4-0QKtGab70s@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-65908-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65908

--- Comment #8 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
I think pushing TYPE_CANONICAL is a bug: we do check ODR properties of the
parameter and TYPE_CANONICAL is not guaranteed to be the same. Just remove the
TYPE_CANONICAL wrap here.

The patch seems OK with this change both for mainline and branch. We will match
the types of DECL_ARGUMENTS when verifying the body here:

  for (arg1 = DECL_ARGUMENTS (decl),
       arg2 = DECL_ARGUMENTS (m_compared_func->decl);
       arg1; arg1 = DECL_CHAIN (arg1), arg2 = DECL_CHAIN (arg2))
    if (!m_checker->compare_decl (arg1, arg2))
      return return_false ();

However I think there is one extra case to deal with. For functions that are
!prototype_p, we get empty ARG_TYPES and only have ARGUMENTS. Such functions
will bypass the checks:

      if (POINTER_TYPE_P (arg_types[i])
          && (TYPE_RESTRICT (arg_types[i]) 
              != TYPE_RESTRICT (m_compared_func->arg_types[i])))
        return return_false_with_msg ("argument restrict flag mismatch");
      /* nonnull_arg_p implies non-zero range to REFERENCE types.  */
      if (POINTER_TYPE_P (arg_types[i])
          && TREE_CODE (arg_types[i])
             != TREE_CODE (m_compared_func->arg_types[i])
          && opt_for_fn (decl, flag_delete_null_pointer_checks))
        return return_false_with_msg ("pointer wrt reference mismatch");

Please factor out this code to a function compatible_parm_types_p and call it
both from sem_function::equals_wpa and the loop above.

Honza


  parent reply	other threads:[~2015-05-12 19:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-27 17:34 [Bug c++/65908] New: internal compiler error: in expand_thunk mark at noffle dot net
2015-04-27 17:47 ` [Bug c++/65908] " mark at noffle dot net
2015-04-27 17:59 ` [Bug ipa/65908] [5/6 Regression] ICE: in expand_thunk, at cgraphunit.c:1700 trippels at gcc dot gnu.org
2015-04-27 22:29 ` jakub at gcc dot gnu.org
2015-04-27 23:09 ` jakub at gcc dot gnu.org
2015-04-28  8:16 ` jakub at gcc dot gnu.org
2015-05-11 11:50 ` hubicka at gcc dot gnu.org
2015-05-12 14:08 ` marxin at gcc dot gnu.org
2015-05-12 19:44 ` hubicka at gcc dot gnu.org [this message]
2015-06-17 13:24 ` jakub at gcc dot gnu.org
2015-06-17 13:29 ` marxin at gcc dot gnu.org
2015-06-22  7:12 ` hubicka at gcc dot gnu.org
2015-07-03  9:11 ` [Bug ipa/65908] [5 " rguenth at gcc dot gnu.org
2015-07-16  9:15 ` rguenth at gcc dot gnu.org

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=bug-65908-4-0QKtGab70s@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).