From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36714 invoked by alias); 10 Apr 2015 10:50:38 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 36647 invoked by uid 48); 10 Apr 2015 10:50:34 -0000 From: "jaehnesn at gmx dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/65695] [4.9/5 Regression] NSDMI calling constexpr constructor with pointer-to-member is not a constant expression Date: Fri, 10 Apr 2015 10:50: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: 5.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: jaehnesn at gmx dot de X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: 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: 2015-04/txt/msg00827.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D65695 Sebastian J=C3=A4hne changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jaehnesn at gmx dot de --- Comment #4 from Sebastian J=C3=A4hne --- (In reply to Jonathan Wakely from comment #0) > From https://gcc.gnu.org/ml/gcc-help/2015-04/msg00034.html >=20 > template > struct Bar > { > using MemberFuncT =3D int (T::*)(); >=20 > MemberFuncT h_; > constexpr Bar(MemberFuncT h) : h_{h} > { > } > }; >=20 > struct Foo > { > int test() > { > return -1; > } >=20 > // this causes the brace-enclosed initializer error message: > static constexpr Bar bar =3D Bar(&Foo::test); >=20 > // but this line does not: > // static constexpr Bar bar =3D Bar(nullptr); >=20 > // this line also causes the error message, unless you remove the > // explict constructor in Bar. > // static constexpr Bar bar =3D {&Foo::test}; > }; >=20 > constexpr Bar Foo::bar; >=20 > // the line below does not cause any problems, either: > // static constexpr Bar bar =3D Bar(&Foo::test); >=20 > int main(void) > { > Foo f; > return (f.*(Foo::bar.h_))(); > } >=20 > c.cc:20:56: error: =E2=80=98Bar{&Foo::test}=E2=80=99 is not a consta= nt expression > static constexpr Bar bar =3D Bar(&Foo::test); > ^ >=20 > Clang and EDG accept the code. If you change your code in the following manner, it works: template struct Bar { using MemberFuncT =3D int (*)(); MemberFuncT h_; constexpr Bar(MemberFuncT h) : h_{h} { } }; struct Foo { static int test() { return -1; } static constexpr Bar bar =3D Bar(&Foo::test); }; constexpr Bar Foo::bar; int main(void) { Foo f; return (f.bar.h_)(); } You shouldn't be able to declare a static variable which has access to a non-static member function. I would call this a bug in CLANG and EDG. >>From gcc-bugs-return-483276-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Apr 10 10:55:21 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 42824 invoked by alias); 10 Apr 2015 10:55:21 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 42783 invoked by uid 48); 10 Apr 2015 10:55:17 -0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/65695] [4.9/5 Regression] NSDMI calling constexpr constructor with pointer-to-member is not a constant expression Date: Fri, 10 Apr 2015 10:55: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: 5.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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: 2015-04/txt/msg00828.txt.bz2 Content-length: 428 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D65695 --- Comment #5 from Jonathan Wakely --- (In reply to Sebastian J=C3=A4hne from comment #4) > You shouldn't be able to declare a static variable which has access to a > non-static member function. I would call this a bug in CLANG and EDG. Why not? Taking the address of the member function (&Foo::test) doesn't req= uire an instance of the object. >>From gcc-bugs-return-483277-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Apr 10 11:01:11 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 48607 invoked by alias); 10 Apr 2015 11:01:11 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 48306 invoked by uid 48); 10 Apr 2015 11:01:07 -0000 From: "jaehnesn at gmx dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/65695] [4.9/5 Regression] NSDMI calling constexpr constructor with pointer-to-member is not a constant expression Date: Fri, 10 Apr 2015 11:01: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: 5.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: jaehnesn at gmx dot de X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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: 2015-04/txt/msg00829.txt.bz2 Content-length: 670 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D65695 --- Comment #6 from Sebastian J=C3=A4hne --- (In reply to Jonathan Wakely from comment #5) > (In reply to Sebastian J=C3=A4hne from comment #4) > > You shouldn't be able to declare a static variable which has access to a > > non-static member function. I would call this a bug in CLANG and EDG. >=20 > Why not? Taking the address of the member function (&Foo::test) doesn't > require an instance of the object. It does. Member functions need an object in order to operate. Only static member functions don't need an object (which is why you can invoke them like Class::StaticMemberFunc()). >>From gcc-bugs-return-483278-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Apr 10 11:11:02 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 7019 invoked by alias); 10 Apr 2015 11:11:02 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 6945 invoked by uid 48); 10 Apr 2015 11:10:58 -0000 From: "daniel.kruegler at googlemail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/65695] [4.9/5 Regression] NSDMI calling constexpr constructor with pointer-to-member is not a constant expression Date: Fri, 10 Apr 2015 11:11: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: 5.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: daniel.kruegler at googlemail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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: 2015-04/txt/msg00830.txt.bz2 Content-length: 563 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D65695 --- Comment #7 from Daniel Kr=C3=BCgler --- (In reply to Sebastian J=C3=A4hne from comment #6) > It does.=20 No, it doesn't. > Member functions need an object in order to operate.=20 It only needs an object, if the function is going to invoked, but this is n= ot happening here. > Only static > member functions don't need an object (which is why you can invoke them l= ike > Class::StaticMemberFunc()). The object is not of relevance for the described example. >>From gcc-bugs-return-483279-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Apr 10 11:11:39 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 10428 invoked by alias); 10 Apr 2015 11:11:38 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 8750 invoked by uid 48); 10 Apr 2015 11:11:34 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/57796] AVX2 gather vectorization: code bloat and reduction of performance Date: Fri, 10 Apr 2015 11:11: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.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.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: Message-ID: In-Reply-To: References: 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: 2015-04/txt/msg00831.txt.bz2 Content-length: 322 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57796 --- Comment #6 from Richard Biener --- vect_model_load_cost has no special-casing of gathers thus it is probably treated as having the same cost as a regular vector load. Btw, having a small testcase for this particular bug would be nice.