Re: Missed optimization with const member

2017-07-05 Thread Oleg Endo
Hi, On Wed, 2017-07-05 at 02:02 +0200, Geza Herman wrote: >  > Here's what happens: in callInitA(), an Object put onto the stack (which  > has a const member variable, initialized to 0). Then somefunction called  > (which is intentionally not defined). Then ~Object() is called, which  > has an "if

whereis asm_nodes? how to migrate it for GCC v6.x?

2017-07-05 Thread Leslie Zhai
Hi GCC developers, There was extern GTY(()) struct asm_node *asm_nodes; for GCC v4.x, but how to migrate it for v6.x? there is no asm_nodes deprecated log in ChangeLog-201X nor git log cgraph.h... please give me some hint, thanks a lot! -- Regards, Leslie Zhai https://reviews.llvm.org/p/xia

Re: whereis asm_nodes? how to migrate it for GCC v6.x?

2017-07-05 Thread Segher Boessenkool
Hi Leslie, On Wed, Jul 05, 2017 at 05:36:15PM +0800, Leslie Zhai wrote: > There was > > extern GTY(()) struct asm_node *asm_nodes; > > for GCC v4.x, but how to migrate it for v6.x? there is no asm_nodes > deprecated log in ChangeLog-201X nor git log cgraph.h... please give me > some hint, than

Re: Missed optimization with const member

2017-07-05 Thread Jonathan Wakely
On 5 July 2017 at 10:13, Oleg Endo wrote: > Hi, > > On Wed, 2017-07-05 at 02:02 +0200, Geza Herman wrote: >> >> Here's what happens: in callInitA(), an Object put onto the stack (which >> has a const member variable, initialized to 0). Then somefunction called >> (which is intentionally not defined

Re: Missed optimization with const member

2017-07-05 Thread Geza Herman
On 07/05/2017 01:14 PM, Jonathan Wakely wrote: I think the reason it's not optimized away is for this case: void somefunction(const Object& object); { void* p = &object; object.~Object(); new(p) Object(); } This means that after calling someFunction there could be a different object at

Re: Missed optimization with const member

2017-07-05 Thread Oleg Endo
On Wed, 2017-07-05 at 12:14 +0100, Jonathan Wakely wrote: >  > No, that would be undefined behaviour. The data member is defined as > const, so it's not possible to write to that member without undefined > behaviour. A variable defined with a const type is not the same as a > variable accessed thro

Re: Missed optimization with const member

2017-07-05 Thread Martin Sebor
On 07/04/2017 06:02 PM, Geza Herman wrote: Hi, I've included a small program at the end of my email. Here's what happens: in callInitA(), an Object put onto the stack (which has a const member variable, initialized to 0). Then somefunction called (which is intentionally not defined). Then ~Obje

RFC: Add ___tls_get_addr

2017-07-05 Thread H.J. Lu
On x86-64, __tls_get_addr has to realigns stack so that binaries compiled by GCCs older than GCC 4.9.4: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58066 continue to work even if vector instructions are used by functions called from __tls_get_addr, which assumes 16-byte stack alignment as specif

Re: RFC: Add ___tls_get_addr

2017-07-05 Thread Carlos O'Donell
On 07/05/2017 11:38 AM, H.J. Lu wrote: > On x86-64, __tls_get_addr has to realigns stack so that binaries compiled by > GCCs older than GCC 4.9.4: > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58066 > > continue to work even if vector instructions are used by functions called > from __tls_get_

Re: RFC: Add ___tls_get_addr

2017-07-05 Thread Szabolcs Nagy
On 05/07/17 16:38, H.J. Lu wrote: > On x86-64, __tls_get_addr has to realigns stack so that binaries compiled by > GCCs older than GCC 4.9.4: > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58066 > > continue to work even if vector instructions are used by functions called > from __tls_get_addr,

Re: RFC: Add ___tls_get_addr

2017-07-05 Thread Rich Felker
On Wed, Jul 05, 2017 at 08:38:50AM -0700, H.J. Lu wrote: > On x86-64, __tls_get_addr has to realigns stack so that binaries compiled by > GCCs older than GCC 4.9.4: > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58066 > > continue to work even if vector instructions are used by functions called

Re: RFC: Add ___tls_get_addr

2017-07-05 Thread Florian Weimer
On 07/05/2017 05:38 PM, H.J. Lu wrote: > We are considering to add an alternative interface, ___tls_get_addr, to > glibc, which doesn't realign stack. Compilers, which properly align stack > for TLS, call generate call to ___tls_get_addr, instead of __tls_get_addr, > if ___tls_get_addr is availabl

Re: RFC: Add ___tls_get_addr

2017-07-05 Thread H.J. Lu
On Wed, Jul 5, 2017 at 8:53 AM, Szabolcs Nagy wrote: > On 05/07/17 16:38, H.J. Lu wrote: >> On x86-64, __tls_get_addr has to realigns stack so that binaries compiled by >> GCCs older than GCC 4.9.4: >> >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58066 >> >> continue to work even if vector inst

Re: RFC: Add ___tls_get_addr

2017-07-05 Thread H.J. Lu
On Wed, Jul 5, 2017 at 8:51 AM, Carlos O'Donell wrote: > On 07/05/2017 11:38 AM, H.J. Lu wrote: >> On x86-64, __tls_get_addr has to realigns stack so that binaries compiled by >> GCCs older than GCC 4.9.4: >> >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58066 >> >> continue to work even if vect

Re: RFC: Add ___tls_get_addr

2017-07-05 Thread H.J. Lu
On Wed, Jul 5, 2017 at 9:27 AM, Florian Weimer wrote: > On 07/05/2017 06:21 PM, H.J. Lu wrote: >> On Wed, Jul 5, 2017 at 9:18 AM, Florian Weimer wrote: >>> On 07/05/2017 06:17 PM, H.J. Lu wrote: On Wed, Jul 5, 2017 at 9:09 AM, Florian Weimer wrote: > On 07/05/2017 05:38 PM, H.J. Lu wrot

Re: Missed optimization with const member

2017-07-05 Thread Geza Herman
On 07/05/2017 01:26 PM, Geza Herman wrote: On 07/05/2017 01:14 PM, Jonathan Wakely wrote: I think the reason it's not optimized away is for this case: void somefunction(const Object& object); { void* p = &object; object.~Object(); new(p) Object(); } This means that after calling someF

Re: Missed optimization with const member

2017-07-05 Thread Yuri Gribov
On Wed, Jul 5, 2017 at 12:14 PM, Jonathan Wakely wrote: > On 5 July 2017 at 10:13, Oleg Endo wrote: >> Hi, >> >> On Wed, 2017-07-05 at 02:02 +0200, Geza Herman wrote: >>> >>> Here's what happens: in callInitA(), an Object put onto the stack (which >>> has a const member variable, initialized to 0)