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/67600] [5/6 Regression] Segfault when assigning only one char to ostreambuf_iterator<char> compiled with -O2 or -O3
Date: Fri, 16 Oct 2015 06:08:00 -0000	[thread overview]
Message-ID: <bug-67600-4-N68PdIF24E@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-67600-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
OK,
the problem is that we loss offset of 64.  This happens in get_dynamic_type
where we restrict to inner class and get difference in between offset inside
restricted type and offset from basic instance pointer.

I am testing the following:
Index: ipa-polymorphic-call.c
===================================================================
--- ipa-polymorphic-call.c      (revision 228735)
+++ ipa-polymorphic-call.c      (working copy)
@@ -1621,13 +1637,13 @@ ipa_polymorphic_call_context::get_dynami
       print_generic_expr (dump_file, otr_object, TDF_SLIM);
       fprintf (dump_file, "  Outer instance pointer: ");
       print_generic_expr (dump_file, instance, TDF_SLIM);
-      fprintf (dump_file, " offset: %i (bits)", (int)offset);
+      fprintf (dump_file, " offset: %i (bits)", (int)instance_offset);
       fprintf (dump_file, " vtbl reference: ");
       print_generic_expr (dump_file, instance_ref, TDF_SLIM);
       fprintf (dump_file, "\n");
     }

-  tci.offset = offset;
+  tci.offset = instance_offset;
   tci.instance = instance;
   tci.vtbl_ptr_ref = instance_ref;
   gcc_assert (TREE_CODE (instance) != MEM_REF);


will need to re-read the code to double check it works as intended now, but I
would think so ;)

Honza


  parent reply	other threads:[~2015-10-16  6:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-16 11:23 [Bug libstdc++/67600] New: [5/6] " cctsai57 at gmail dot com
2015-09-16 11:35 ` [Bug ipa/67600] [5/6 Regression] " rguenth at gcc dot gnu.org
2015-09-16 11:37 ` rguenth at gcc dot gnu.org
2015-10-12  8:15 ` hubicka at gcc dot gnu.org
2015-10-16  6:08 ` hubicka at gcc dot gnu.org [this message]
2015-10-24 17:02 ` miyuki at gcc dot gnu.org
2015-10-24 17:34 ` trippels at gcc dot gnu.org
2015-10-25 14:13 ` hjl.tools at gmail dot com
2015-10-28 13:44 ` [Bug ipa/67600] [5 " rguenth at gcc dot gnu.org
2015-10-28 13:44 ` 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-67600-4-N68PdIF24E@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).