public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51373] New: ICE for static pointer to member initialized in-class
@ 2011-12-01  4:36 pubby.8 at gmail dot com
  2011-12-01  9:19 ` [Bug c++/51373] [C++0x] " paolo.carlini at oracle dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: pubby.8 at gmail dot com @ 2011-12-01  4:36 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51373
           Summary: ICE for static pointer to member initialized in-class
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: pubby.8@gmail.com


gcc version 4.7.0 20111112 (experimental) (GCC) 

Two seemingly relate ICEs when dealing with pointer to member:

struct foo {
    int a = 42;
    static int foo::*b = &foo::a;
};
internal compiler error: Segmentation fault

struct foo {
    int a = 42;
    static int foo::*b;
    auto& c = b;
};
internal compiler error: in unify_one_argument, at cp/pt.c:15008

Not sure if the code is valid.


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

* [Bug c++/51373] [C++0x] ICE for static pointer to member initialized in-class
  2011-12-01  4:36 [Bug c++/51373] New: ICE for static pointer to member initialized in-class pubby.8 at gmail dot com
@ 2011-12-01  9:19 ` paolo.carlini at oracle dot com
  2011-12-03 19:18 ` daniel.kruegler at googlemail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-12-01  9:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-12-01
            Summary|ICE for static pointer to   |[C++0x] ICE for static
                   |member initialized in-class |pointer to member
                   |                            |initialized in-class
     Ever Confirmed|0                           |1


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

* [Bug c++/51373] [C++0x] ICE for static pointer to member initialized in-class
  2011-12-01  4:36 [Bug c++/51373] New: ICE for static pointer to member initialized in-class pubby.8 at gmail dot com
  2011-12-01  9:19 ` [Bug c++/51373] [C++0x] " paolo.carlini at oracle dot com
@ 2011-12-03 19:18 ` daniel.kruegler at googlemail dot com
  2011-12-03 19:34 ` daniel.kruegler at googlemail dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2011-12-03 19:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler at
                   |                            |googlemail dot com

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2011-12-03 19:17:09 UTC ---
(In reply to comment #0)
> gcc version 4.7.0 20111112 (experimental) (GCC) 

Also in 4.7.0 20111126 (experimental)

> Two seemingly relate ICEs when dealing with pointer to member:
> 
> struct foo {
>     int a = 42;
>     static int foo::*b = &foo::a;
> };

b needs to have a constexpr specifier here, but it ICEs also with that one
added. Even with the constexpr specifier that declaration should be ill-formed,
because the class definition must be complete for an in-class static data
member initializer. Also, the initializer for a is not needed to reproduce the
error.

> struct foo {
>     int a = 42;
>     static int foo::*b;
>     auto& c = b;
> };
> internal compiler error: in unify_one_argument, at cp/pt.c:15008

The declaration of c cannot use auto (only static data members may do) and the
ICE does no longer occur after the fix. In addition, the declaration of a is
not needed to reproduce the problem.


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

* [Bug c++/51373] [C++0x] ICE for static pointer to member initialized in-class
  2011-12-01  4:36 [Bug c++/51373] New: ICE for static pointer to member initialized in-class pubby.8 at gmail dot com
  2011-12-01  9:19 ` [Bug c++/51373] [C++0x] " paolo.carlini at oracle dot com
  2011-12-03 19:18 ` daniel.kruegler at googlemail dot com
@ 2011-12-03 19:34 ` daniel.kruegler at googlemail dot com
  2014-06-06 11:25 ` vl.still at gmail dot com
  2014-06-06 12:14 ` vl.still at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2011-12-03 19:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2011-12-03 19:33:55 UTC ---
(In reply to comment #1)

> Even with the constexpr specifier that declaration should be ill-formed,
> because the class definition must be complete for an in-class static data
> member initializer. 

I just recognize that the class definition must not be complete to make the
pointer of member formation a constant expression. So, the code of the first
example should be well-formed after addition of constexpr to the static data
member.


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

* [Bug c++/51373] [C++0x] ICE for static pointer to member initialized in-class
  2011-12-01  4:36 [Bug c++/51373] New: ICE for static pointer to member initialized in-class pubby.8 at gmail dot com
                   ` (2 preceding siblings ...)
  2011-12-03 19:34 ` daniel.kruegler at googlemail dot com
@ 2014-06-06 11:25 ` vl.still at gmail dot com
  2014-06-06 12:14 ` vl.still at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: vl.still at gmail dot com @ 2014-06-06 11:25 UTC (permalink / raw)
  To: gcc-bugs

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

Vladimír Štill <vl.still at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vl.still at gmail dot com

--- Comment #3 from Vladimír Štill <vl.still at gmail dot com> ---
Created attachment 32899
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32899&action=edit
gcc -v result
>From gcc-bugs-return-453384-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Jun 06 11:27:05 2014
Return-Path: <gcc-bugs-return-453384-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 18045 invoked by alias); 6 Jun 2014 11:27:05 -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 17999 invoked by uid 48); 6 Jun 2014 11:27:01 -0000
From: "vl.still at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/51373] [C++0x] ICE for static pointer to member initialized in-class
Date: Fri, 06 Jun 2014 11:27: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.7.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: vl.still at gmail 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-51373-4-BNtX1GuDXP@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-51373-4@http.gcc.gnu.org/bugzilla/>
References: <bug-51373-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: 2014-06/txt/msg00466.txt.bz2
Content-length: 394

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

--- Comment #4 from Vladimír Štill <vl.still at gmail dot com> ---
Problem is still present in 4.8.2, reproduce with following code, which
compiles in clang 3.4 (both with -std=c++11):
struct Y {
    int o;
    static constexpr int Y::* x = &Y::o;
};

gcc -v result included in previous comment. Tested on NixOS linux x86_64.
>From gcc-bugs-return-453385-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Jun 06 11:39:39 2014
Return-Path: <gcc-bugs-return-453385-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 26033 invoked by alias); 6 Jun 2014 11:39:39 -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 25984 invoked by uid 48); 6 Jun 2014 11:39:35 -0000
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/51373] [C++0x] ICE for static pointer to member initialized in-class
Date: Fri, 06 Jun 2014 11:39: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.7.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: redi at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_known_to_work resolution target_milestone
Message-ID: <bug-51373-4-YbD69d0z0u@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-51373-4@http.gcc.gnu.org/bugzilla/>
References: <bug-51373-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: 2014-06/txt/msg00467.txt.bz2
Content-length: 557

https://gcc.gnu.org/bugzilla/show_bug.cgi?idQ373

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to work|                            |4.10.0, 4.9.0
         Resolution|---                         |FIXED
   Target Milestone|---                         |4.9.0

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed in 4.9.0 though


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

* [Bug c++/51373] [C++0x] ICE for static pointer to member initialized in-class
  2011-12-01  4:36 [Bug c++/51373] New: ICE for static pointer to member initialized in-class pubby.8 at gmail dot com
                   ` (3 preceding siblings ...)
  2014-06-06 11:25 ` vl.still at gmail dot com
@ 2014-06-06 12:14 ` vl.still at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: vl.still at gmail dot com @ 2014-06-06 12:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Vladimír Štill <vl.still at gmail dot com> ---
(In reply to Jonathan Wakely from comment #5)
> Fixed in 4.9.0 though

I'm glad to hear that, I could not yet installed 4.9.0 in my OS.
>From gcc-bugs-return-453388-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Jun 06 12:19:08 2014
Return-Path: <gcc-bugs-return-453388-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 18012 invoked by alias); 6 Jun 2014 12:19: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 17946 invoked by uid 48); 6 Jun 2014 12:19:04 -0000
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/56888] memcpy implementation optimized as a call to memcpy
Date: Fri, 06 Jun 2014 12:19:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 4.8.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jakub 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-56888-4-Ja1j4TgcKk@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-56888-4@http.gcc.gnu.org/bugzilla/>
References: <bug-56888-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: 2014-06/txt/msg00470.txt.bz2
Content-length: 239

https://gcc.gnu.org/bugzilla/show_bug.cgi?idV888

--- Comment #33 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Yeah, I'd say we could document that gcc doesn't support any implementations
where memcpy/memmove/memset clobber errno.


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

end of thread, other threads:[~2014-06-06 12:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-01  4:36 [Bug c++/51373] New: ICE for static pointer to member initialized in-class pubby.8 at gmail dot com
2011-12-01  9:19 ` [Bug c++/51373] [C++0x] " paolo.carlini at oracle dot com
2011-12-03 19:18 ` daniel.kruegler at googlemail dot com
2011-12-03 19:34 ` daniel.kruegler at googlemail dot com
2014-06-06 11:25 ` vl.still at gmail dot com
2014-06-06 12:14 ` vl.still at gmail dot com

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