public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57825] New: Template specialization for ref qualified member pointers
@ 2013-07-04 19:10 tomaszkam at gmail dot com
  2013-07-04 19:29 ` [Bug c++/57825] " daniel.kruegler at googlemail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: tomaszkam at gmail dot com @ 2013-07-04 19:10 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 57825
           Summary: Template specialization for ref qualified member
                    pointers
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tomaszkam at gmail dot com

Created attachment 30460
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30460&action=edit
Bugus code exmaple

The class template specialization for member pointers that differs only on ref
qualification issue double redefinition error. 

For example the compilation of following code:
template<typename T>
struct target_class
{};

template<typename Class, typename Ret, typename... Args>
struct target_class<Ret (Class::*)(Args...)>
{};

template<typename Class, typename Ret, typename... Args>
struct target_class<Ret (Class::*)(Args...) &>
{};

template<typename Class, typename Ret, typename... Args>
struct target_class<Ret (Class::*)(Args...) &&>
{};

Will result in the following buggy errors:
template_ref_bug.cpp:10:8: error: redefinition of ‘struct target_class<Ret
(Class::*)(Args ...)>’
 struct target_class<Ret (Class::*)(Args...) &>
        ^
template_ref_bug.cpp:6:8: error: previous definition of ‘struct
target_class<Ret (Class::*)(Args ...)>’
 struct target_class<Ret (Class::*)(Args...)>
        ^
template_ref_bug.cpp:14:8: error: redefinition of ‘struct target_class<Ret
(Class::*)(Args ...)>’
 struct target_class<Ret (Class::*)(Args...) &&>
        ^
template_ref_bug.cpp:6:8: error: previous definition of ‘struct
target_class<Ret (Class::*)(Args ...)>’
 struct target_class<Ret (Class::*)(Args...)>
>From gcc-bugs-return-425774-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jul 04 19:15:47 2013
Return-Path: <gcc-bugs-return-425774-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 23668 invoked by alias); 4 Jul 2013 19:15:46 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 23621 invoked by uid 55); 4 Jul 2013 19:15:44 -0000
From: "joseph at codesourcery dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/29776] result of ffs/clz/ctz/popcount/parity are already sign-extended
Date: Thu, 04 Jul 2013 19:15:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.3.0
X-Bugzilla-Keywords: missed-optimization
X-Bugzilla-Severity: normal
X-Bugzilla-Who: joseph at codesourcery dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-29776-4-NqdyJUedYP@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-29776-4@http.gcc.gnu.org/bugzilla/>
References: <bug-29776-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-07/txt/msg00281.txt.bz2
Content-length: 555

http://gcc.gnu.org/bugzilla/show_bug.cgi?id)776

--- Comment #13 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
For the RTL operations and optabs, we have CLZ_DEFINED_VALUE_AT_ZERO and
CTZ_DEFINED_VALUE_AT_ZERO, but as noted in the documentation they do not
refer to definedness for the built-in functions.  (That's similar to
SHIFT_COUNT_TRUNCATED / TARGET_SHIFT_TRUNCATION_MASK, which again describe
semantics at the RTL level but do not affect the undefinedness of
out-of-range shifts in C/C++ source code or GIMPLE.)


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/57825] Template specialization for ref qualified member pointers
  2013-07-04 19:10 [Bug c++/57825] New: Template specialization for ref qualified member pointers tomaszkam at gmail dot com
@ 2013-07-04 19:29 ` daniel.kruegler at googlemail dot com
  2013-07-04 19:35 ` daniel.kruegler at googlemail dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2013-07-04 19:29 UTC (permalink / raw)
  To: gcc-bugs

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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler@googlemail.
                   |                            |com

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
This problem also exists in gcc 4.9.0 20130616 (experimental)
>From gcc-bugs-return-425776-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jul 04 19:31:06 2013
Return-Path: <gcc-bugs-return-425776-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 2032 invoked by alias); 4 Jul 2013 19:31:06 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 2009 invoked by uid 48); 4 Jul 2013 19:31:03 -0000
From: "tomaszkam at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/57825] Template specialization for ref qualified member pointers
Date: Thu, 04 Jul 2013 19:31:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.8.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: tomaszkam at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-57825-4-Na58ktd4xt@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57825-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57825-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-07/txt/msg00283.txt.bz2
Content-length: 693

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

--- Comment #2 from Tomasz Kamiński <tomaszkam at gmail dot com> ---
Propably this is also causing the problem with the standard library is_function
and is_member function traits, because they cannot be implemented correclty.

Example:
struct A
{
  void f_n() {}
  void f_l() &{}
  void f_r() &&{}
};

The following assertions fails incorrectly.
static_assert(std::is_function<void()&>::value, "function");
static_assert(std::is_member_pointer<void (A::*)()&>::value, "member
function");

static_assert(std::is_function<void()&&>::value, "function");
static_assert(std::is_member_pointer<void (A::*)()&&>::value, "member
function");
>From gcc-bugs-return-425777-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jul 04 19:33:47 2013
Return-Path: <gcc-bugs-return-425777-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 3374 invoked by alias); 4 Jul 2013 19:33:47 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 3348 invoked by uid 48); 4 Jul 2013 19:33:44 -0000
From: "paolo.carlini at oracle dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/57825] Template specialization for ref qualified member pointers
Date: Thu, 04 Jul 2013 19:33:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.8.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: paolo.carlini at oracle dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-57825-4-IUmpAKvEQB@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57825-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57825-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-07/txt/msg00284.txt.bz2
Content-length: 183

http://gcc.gnu.org/bugzilla/show_bug.cgi?idW825

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Daniel, which library testcases did we commit?!? ;) Crazy.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/57825] Template specialization for ref qualified member pointers
  2013-07-04 19:10 [Bug c++/57825] New: Template specialization for ref qualified member pointers tomaszkam at gmail dot com
  2013-07-04 19:29 ` [Bug c++/57825] " daniel.kruegler at googlemail dot com
@ 2013-07-04 19:35 ` daniel.kruegler at googlemail dot com
  2013-07-04 19:48 ` paolo.carlini at oracle dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2013-07-04 19:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
(In reply to Tomasz Kamiński from comment #2)
> Propably this is also causing the problem with the standard library
> is_function and is_member function traits, because they cannot be
> implemented correclty.

No, this was a different problem and it became fixed. Your example code works
fine gcc 4.9.0 20130616 (experimental) (I do know this, because I recently
completed the implementation of std::function for gcc)
>From gcc-bugs-return-425779-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jul 04 19:43:06 2013
Return-Path: <gcc-bugs-return-425779-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 7147 invoked by alias); 4 Jul 2013 19:43:06 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 7098 invoked by uid 48); 4 Jul 2013 19:42:57 -0000
From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/57825] Template specialization for ref qualified member pointers
Date: Thu, 04 Jul 2013 19:43:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.8.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: daniel.kruegler at googlemail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-57825-4-8vR4JxECvI@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57825-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57825-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-07/txt/msg00286.txt.bz2
Content-length: 459

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

--- Comment #5 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
(In reply to Paolo Carlini from comment #3)
> Daniel, which library testcases did we commit?!? ;) Crazy.

During an intermediate state we had bug 57388 which prevented for some time the
proper specialization of std::is_function. The difference in the here discussed
case is the specialization for pointer to members
>From gcc-bugs-return-425780-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jul 04 19:46:10 2013
Return-Path: <gcc-bugs-return-425780-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 8601 invoked by alias); 4 Jul 2013 19:46:10 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 8555 invoked by uid 48); 4 Jul 2013 19:46:07 -0000
From: "glisse at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/29776] result of ffs/clz/ctz/popcount/parity are already sign-extended
Date: Thu, 04 Jul 2013 19:46:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.3.0
X-Bugzilla-Keywords: missed-optimization
X-Bugzilla-Severity: normal
X-Bugzilla-Who: glisse at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-29776-4-1JSwq42k3U@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-29776-4@http.gcc.gnu.org/bugzilla/>
References: <bug-29776-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-07/txt/msg00287.txt.bz2
Content-length: 1279

http://gcc.gnu.org/bugzilla/show_bug.cgi?id)776

--- Comment #14 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #12)
> Not all CPUs that have defined behavior for 0 define it to the precision
> though, and even on i?86 it is undefined even when using lzcnt/tzcnt on
> older CPUs.
> Even the libgcc routines provide various return values for 0 depending on
> target (look for COUNT_LEADING_ZEROS_0).
> So it is not an option to redefine the builtins, they are undefined behavior
> for 0 and that can't change.

I didn't mean to document the value for 0 or have other optimizations create
calls to this builtin relying on this property. I just meant that if we already
have a call to clz and the argument happens to be 0 (which is undefined), we
could optimize based on the assumption that the result is the precision, that
may break less code than your current patch. Otherwise we might as well assert
(well, tell it to VRP) that the argument is non-zero.

But you are probably right that trying to work around the undefined value for 0
is wrong, another builtin should be used instead.

> There is __builtin_ffs that provides defined behavior for 0.

So, should that be used for the x86 and power intrinsics? Or a new
__builtin_clz0?


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/57825] Template specialization for ref qualified member pointers
  2013-07-04 19:10 [Bug c++/57825] New: Template specialization for ref qualified member pointers tomaszkam at gmail dot com
  2013-07-04 19:29 ` [Bug c++/57825] " daniel.kruegler at googlemail dot com
  2013-07-04 19:35 ` daniel.kruegler at googlemail dot com
@ 2013-07-04 19:48 ` paolo.carlini at oracle dot com
  2013-07-04 19:57 ` tomaszkam at gmail dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-07-04 19:48 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-07-04
                 CC|                            |jason at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Ah I see (I'm traveling): it's simply that in our implementation we don't need
such specializations. Still, the issue is annoying, let's add in CC Jason,
probably some mangling bits are still missing.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/57825] Template specialization for ref qualified member pointers
  2013-07-04 19:10 [Bug c++/57825] New: Template specialization for ref qualified member pointers tomaszkam at gmail dot com
                   ` (2 preceding siblings ...)
  2013-07-04 19:48 ` paolo.carlini at oracle dot com
@ 2013-07-04 19:57 ` tomaszkam at gmail dot com
  2013-08-06 23:50 ` jason at gcc dot gnu.org
  2013-08-07  1:20 ` jason at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: tomaszkam at gmail dot com @ 2013-07-04 19:57 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 6341 bytes --]

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

--- Comment #7 from Tomasz Kamiński <tomaszkam at gmail dot com> ---
> No, this was a different problem and it became fixed. Your example code
> works fine gcc 4.9.0 20130616 (experimental) (I do know this, because I
> recently completed the implementation of std::function for gcc)

Thank you. I assumed that this is not working also for normal functions.
>From gcc-bugs-return-425783-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jul 04 20:41:07 2013
Return-Path: <gcc-bugs-return-425783-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 13580 invoked by alias); 4 Jul 2013 20:41:07 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 13217 invoked by uid 48); 4 Jul 2013 20:41:02 -0000
From: "fdumont at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/57779] vector insert fails to diagnose iterators pointing into *this in debug mode
Date: Thu, 04 Jul 2013 20:41:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 4.7.3
X-Bugzilla-Keywords:
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: fdumont at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: fdumont at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on cc assigned_to everconfirmed
Message-ID: <bug-57779-4-eUoij3YOdH@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57779-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57779-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-07/txt/msg00290.txt.bz2
Content-length: 1123

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

François Dumont <fdumont at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2013-07-04
                 CC|                            |fdumont at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |fdumont at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #2 from François Dumont <fdumont at gcc dot gnu.org> ---
Sure I can take care of it.

The Standard is saying that for any sequence type this insert operation shall
not take a range pointing back to the sequence. I plan to rather check the
libstdc++ limits as most of its containers allow this kind of insertion. For
the moment I think that only std::vector and std::deque are in this situation,
maybe std::string, I will double check.

The proposed use case is indeed a bit more complicated, I will see if I can
cover it too.
>From gcc-bugs-return-425784-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jul 04 20:49:22 2013
Return-Path: <gcc-bugs-return-425784-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 17943 invoked by alias); 4 Jul 2013 20:49:22 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 17907 invoked by uid 48); 4 Jul 2013 20:49:13 -0000
From: "anders at knatten dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/57826] New: "Internal compiler error: Error reporting routines re-entered" with -Weffc++ and weak_ptr<bool>
Date: Thu, 04 Jul 2013 20:49:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.7.3
X-Bugzilla-Keywords:
X-Bugzilla-Severity: minor
X-Bugzilla-Who: anders at knatten dot org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created
Message-ID: <bug-57826-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-07/txt/msg00291.txt.bz2
Content-length: 1091

http://gcc.gnu.org/bugzilla/show_bug.cgi?idW826

            Bug ID: 57826
           Summary: "Internal compiler error: Error reporting routines
                    re-entered" with -Weffc++ and weak_ptr<bool>
           Product: gcc
           Version: 4.7.3
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anders at knatten dot org

Created attachment 30461
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id0461&actioníit
As requested by "Preprocessed source stored into /tmp/ccEQ3cyg.out file, please
attach this to your bugreport."

When compiling bar.cpp with

g++ -o bar.o -c -std=c++0x -Wall -Wextra -Weffc++ bar.cpp

I get "Internal compiler error: Error reporting routines re-entered.
Please submit a full bug report"

I created the minimum example I could think of that triggers the bug. If you
omit -Weffc++, it compiles. If you omit the weak_ptr<bool> member from Foo, it
also compiles.

I have attached the preprocessed source as requested.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/57825] Template specialization for ref qualified member pointers
  2013-07-04 19:10 [Bug c++/57825] New: Template specialization for ref qualified member pointers tomaszkam at gmail dot com
                   ` (3 preceding siblings ...)
  2013-07-04 19:57 ` tomaszkam at gmail dot com
@ 2013-08-06 23:50 ` jason at gcc dot gnu.org
  2013-08-07  1:20 ` jason at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2013-08-06 23:50 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/57825] Template specialization for ref qualified member pointers
  2013-07-04 19:10 [Bug c++/57825] New: Template specialization for ref qualified member pointers tomaszkam at gmail dot com
                   ` (4 preceding siblings ...)
  2013-08-06 23:50 ` jason at gcc dot gnu.org
@ 2013-08-07  1:20 ` jason at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2013-08-07  1:20 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |4.8.2

--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed in r201550 (trunk) and r201551 (4.8).


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-08-07  1:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-04 19:10 [Bug c++/57825] New: Template specialization for ref qualified member pointers tomaszkam at gmail dot com
2013-07-04 19:29 ` [Bug c++/57825] " daniel.kruegler at googlemail dot com
2013-07-04 19:35 ` daniel.kruegler at googlemail dot com
2013-07-04 19:48 ` paolo.carlini at oracle dot com
2013-07-04 19:57 ` tomaszkam at gmail dot com
2013-08-06 23:50 ` jason at gcc dot gnu.org
2013-08-07  1:20 ` jason at gcc dot gnu.org

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).