Re: [Consult] g++: About "-Wunused-variable" for constant variable initialized by function

2014-10-22 Thread Jonathan Wakely
On 22 October 2014 02:46, Chen Gang wrote: > > > On 10/15/14 18:07, Chen Gang wrote: >> On 10/13/14 21:18, Chen Gang wrote: >>> On 10/13/14 18:53, Jason Merrill wrote: On 10/12/2014 10:32 AM, Chen Gang wrote: >[root@localhost qemu_cc]# cat test.cc >const char n() { return 1; }

Re: [Consult] g++: About "-Wunused-variable" for constant variable initialized by function

2014-10-22 Thread Chen Gang
On 10/22/2014 09:44 PM, Jonathan Wakely wrote: > On 22 October 2014 02:46, Chen Gang wrote: >> On 10/15/14 18:07, Chen Gang wrote: >>> On 10/13/14 21:18, Chen Gang wrote: On 10/13/14 18:53, Jason Merrill wrote: > On 10/12/2014 10:32 AM, Chen Gang wrote: >>[root@localhost qemu_cc]#

Devirtualize virtual call hierarchy if just base dtor exists

2014-10-22 Thread Martin Liška
Hello. I've been playing with following example: #include class Base { public: virtual ~Base() {} }; class Derived: public Base { }; #define N 1000 int main() { Base **b = (Base **)malloc (sizeof(Base *) * N); for (unsigned i = 0; i < N; i++) b[i] = new Derived(); for (unsigned

common subexpression elimination no longer working for asm()?

2014-10-22 Thread Jan Beulich
I noticed the issue with 4.9.1 (in that x86 Linux'es this_cpu_read_stable() no longer does what the comment preceding its definition promises), and the example below demonstrates this in a simplified (but contrived) way. I just now verified that trunk has the same issue; 4.8.3 still folds redundant

Re: Devirtualize virtual call hierarchy if just base dtor exists

2014-10-22 Thread Jonathan Wakely
On 22 October 2014 16:15, Martin Liška wrote: > Hello. > > I've been playing with following example: > > #include > > class Base > { > public: > virtual ~Base() {} > }; > > class Derived: public Base > { > }; > > #define N 1000 > > int main() > { > Base **b = (Base **)malloc (sizeof(Base *) *

Re: Devirtualize virtual call hierarchy if just base dtor exists

2014-10-22 Thread Markus Trippelsdorf
On 2014.10.22 at 17:15 +0200, Martin Liška wrote: > Hello. > > I've been playing with following example: > > #include > > class Base > { > public: >virtual ~Base() {} > }; > > class Derived: public Base > { > }; > > #define N 1000 > > int main() > { >Base **b = (Base **)malloc (sizeo

Re: Account creation disabled on GCC Bugzilla

2014-10-22 Thread Jason Merrill
What should I tell a user who wants to create an account? Jason

Re: Devirtualize virtual call hierarchy if just base dtor exists

2014-10-22 Thread Martin Liška
On 10/22/2014 05:30 PM, Markus Trippelsdorf wrote: On 2014.10.22 at 17:15 +0200, Martin Liška wrote: Hello. I've been playing with following example: #include class Base { public: virtual ~Base() {} }; class Derived: public Base { }; #define N 1000 int main() { Base **b = (Base **

Re: Devirtualize virtual call hierarchy if just base dtor exists

2014-10-22 Thread Martin Liška
On 10/22/2014 05:30 PM, Jonathan Wakely wrote: On 22 October 2014 16:15, Martin Liška wrote: Hello. I've been playing with following example: #include class Base { public: virtual ~Base() {} }; class Derived: public Base { }; #define N 1000 int main() { Base **b = (Base **)malloc (s

Re: Account creation disabled on GCC Bugzilla

2014-10-22 Thread Christopher Faylor
On Wed, Oct 22, 2014 at 11:56:19AM -0400, Jason Merrill wrote: >What should I tell a user who wants to create an account? That they should follow the instructions and contact overseers.

Re: Devirtualize virtual call hierarchy if just base dtor exists

2014-10-22 Thread Jonathan Wakely
On 22 October 2014 17:16, Martin Liška wrote: > On 10/22/2014 05:30 PM, Jonathan Wakely wrote: >> >> On 22 October 2014 16:15, Martin Liška wrote: >>> >>> Hello. >>> >>> I've been playing with following example: >>> >>> #include >>> >>> class Base >>> { >>> public: >>>virtual ~Base() {} >>> }

gcc-4.9-20141022 is now available

2014-10-22 Thread gccadmin
Snapshot gcc-4.9-20141022 is now available on ftp://gcc.gnu.org/pub/gcc/snapshots/4.9-20141022/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 4.9 SVN branch with the following options: svn://gcc.gnu.org/svn/gcc/branches

Bounded Array Type?

2014-10-22 Thread Martin Uecker
Sorry for bringing this up again, but this could work: void foo(int x, int (*s)[x]) { (*s)[x] = 1;// <- undefined behaviour } Such an access beyond the specified length means that either 1. the array is accessed out-of-bounds or 2. was accessed using an incompatible pointer and a