public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/44164] [4.5 Regression] Aliasing bug triggered by Boost.Bind/Boost.Function
Date: Mon, 17 May 2010 15:50:00 -0000	[thread overview]
Message-ID: <20100517155041.22059.qmail@sourceware.org> (raw)
In-Reply-To: <bug-44164-19190@http.gcc.gnu.org/bugzilla/>



------- Comment #5 from rguenth at gcc dot gnu dot org  2010-05-17 15:50 -------
(In reply to comment #4)
> (In reply to comment #3)
> > The boost folks may be able to tell if they at any place copy a
> > function_buffer object via the assignment operator.
> 
> It seems so. From Peter Dimov :
> 
> > [...] after stepping through the code, it turns out that function_buffer is
> > indeed assigned directly, due to the fact that __has_trivial_copy and
> > __has_trivial_destructor report true for the stored function object.

Which means that it is either a C++ frontend bug not protecting this
aggregate assignment properly or a bug in Boost as the functor type stored
to function_buffer is not a member of the union.  The functor types
are for example seen in

            const functor_type* in_functor =
              reinterpret_cast<const functor_type*>(&in_buffer.data);
            new ((void*)&out_buffer.data) functor_type(*in_functor);

but functor_type (a template param) is not a member of said union.

People were arguing that the char member in the union should make this
valid, but nothing in the C++ frontend communicates that to the
alias analysis stage.  People also were arguing only a character
array member would qualify, possibly covering the whole union in size.

A workaround for boost can be constructed following the fix for PR42832.
Due to an unrelated bug using memcpy for the assingment won't work.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
   Last reconfirmed|2010-05-17 09:39:31         |2010-05-17 15:50:41
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44164


  parent reply	other threads:[~2010-05-17 15:50 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-17  8:28 [Bug middle-end/44164] New: [4.5.0] " maxime at altribe dot org
2010-05-17  8:32 ` [Bug middle-end/44164] " maxime at altribe dot org
2010-05-17  9:39 ` [Bug middle-end/44164] [4.5 Regression] " rguenth at gcc dot gnu dot org
2010-05-17  9:44 ` rguenth at gcc dot gnu dot org
2010-05-17 13:10 ` maxime at altribe dot org
2010-05-17 15:50 ` rguenth at gcc dot gnu dot org [this message]
2010-05-17 15:58 ` rguenth at gcc dot gnu dot org
2010-05-17 19:11 ` pdimov at gmail dot com
2010-05-17 19:17 ` pinskia at gcc dot gnu dot org
2010-05-17 20:12 ` pdimov at gmail dot com
2010-05-18 14:58 ` rguenth at gcc dot gnu dot org
2010-05-18 15:01 ` rguenth at gcc dot gnu dot org
2010-05-18 15:02 ` [Bug c++/44164] " rguenth at gcc dot gnu dot org
2010-05-18 20:58 ` pluto at agmk dot net
2010-05-19 13:00 ` rguenth at gcc dot gnu dot org
2010-05-19 22:16 ` jason at gcc dot gnu dot org
2010-05-19 22:53 ` jason at gcc dot gnu dot org
2010-05-20  5:36 ` jason at gcc dot gnu dot org
2010-05-20 11:48 ` rguenther at suse dot de
2010-05-20 13:24 ` rguenth at gcc dot gnu dot org
2010-05-20 14:01 ` jason at gcc dot gnu dot org
2010-05-20 14:02 ` [Bug rtl-optimization/44164] " jason at gcc dot gnu dot org
2010-05-25 13:57 ` rguenth at gcc dot gnu dot org
2010-05-25 14:57 ` rguenth at gcc dot gnu dot org
2010-05-25 15:29 ` rguenth at gcc dot gnu dot org
2010-05-26 10:31 ` rguenth at gcc dot gnu dot org
2010-05-26 11:46 ` rguenth at gcc dot gnu dot org
2010-05-26 11:46 ` rguenth at gcc dot gnu dot org
2010-06-07 16:51 ` jamborm at gcc dot gnu dot 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=20100517155041.22059.qmail@sourceware.org \
    --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).