public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/46188] New: -fipa-cp removes destructor call
@ 2010-10-26 17:05 jens.maurer at gmx dot net
  2010-10-26 19:08 ` [Bug c++/46188] " pinskia at gcc dot gnu.org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: jens.maurer at gmx dot net @ 2010-10-26 17:05 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: -fipa-cp removes destructor call
           Product: gcc
           Version: 4.5.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jens.maurer@gmx.net


Created attachment 22164
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22164
source file to reproduce the bug

In the attached source code, the destructor calls for B::char_array when
destroying "c2" at the end of function "f" are removed by the optimizer when
compiling with -fipa-cp .

I have removed .cfi notes in the assembly quoted below, for conciseness.

bad compile:

$ g++  -S playground.cxx -fverbose-asm -O2

yields (note that no operator delete[] is called on B::char_array):

    159 .LEHB0:
    160         call    g(C const&, C&) #
    161 .LEHE0:
    162         movq    24(%rsp), %rdi  # c2.b_array.data, D.2822
    163         testq   %rdi, %rdi      # D.2822
    164         je      .L15    #,
    165         call    operator delete[](void*)        #
    166 .L15:
    167         movq    16(%rsp), %rdi  # c2.s.adr, D.2837
    168         testq   %rdi, %rdi      # D.2837
    169         je      .L14    #,
    170         call    operator delete[](void*)        #
    171 .L14:
    172         addq    $48, %rsp       #,
    175         popq    %rbx    #
    177         ret


good compile:

$ g++  -S playground.cxx -fverbose-asm -O2 -fno-ipa-cp

    165         call    g(C const&, C&) #
    166 .LEHE0:
    167         movq    8(%rsp), %rbx   # c2.b_array.data, p
    168         testq   %rbx, %rbx      # p
    169         je      .L15    #,
    170         movq    16(%rsp), %r12  # c2.b_array.size, D.2808
    171         testq   %r12, %r12      # D.2808
    172         je      .L16    #,
    173         xorl    %ebp, %ebp      # i
    174         jmp     .L20    #
    175         .p2align 4,,10
    176         .p2align 3
    177 .L25:
    178         addq    $24, %rbx       #, p
    179 .L20:
    180         movq    (%rbx), %rdi    # p->char_array.data, D.2820
    181         testq   %rdi, %rdi      # D.2820
    182         je      .L18    #,
    183         call    operator delete[](void*)        #
    184 .L18:
    185         addq    $1, %rbp        #, i
    186         cmpq    %rbp, %r12      # i, D.2808
    187         ja      .L25    #,
    188         movq    8(%rsp), %rbx   # c2.b_array.data, p
    189 .L16:
    190         testq   %rbx, %rbx      # p
    191         je      .L15    #,
    192         movq    %rbx, %rdi      # p,
    193         call    operator delete[](void*)        #
    194 .L15:
    195         movq    (%rsp), %rdi    # c2.s.adr, D.2824
    196         testq   %rdi, %rdi      # D.2824
    197         je      .L14    #,
    198         call    operator delete[](void*)        #
    199 .L14:
    200         addq    $32, %rsp       #,
    203         popq    %rbx    #
    205         popq    %rbp    #
    207         popq    %r12    #
    209         ret


Removing any one of the seemingly unrelated lines marked ##1, ##2, ##3 will
produce correct compiler output.  Also, messing with the Array::destruct
function (e.g. use "data + i" instead of "p", use the constants for start/end
directly instead of passing via parameters) will remove the problem.


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

* [Bug c++/46188] -fipa-cp removes destructor call
  2010-10-26 17:05 [Bug c++/46188] New: -fipa-cp removes destructor call jens.maurer at gmx dot net
@ 2010-10-26 19:08 ` pinskia at gcc dot gnu.org
  2010-10-26 21:09 ` jens.maurer at gmx dot net
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu.org @ 2010-10-26 19:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2010-10-26 19:08:37 UTC ---
I think this has some undefined code in it.

The dynamic type of this->data changes a few times and I don't know the current
type when delete[] is called.


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

* [Bug c++/46188] -fipa-cp removes destructor call
  2010-10-26 17:05 [Bug c++/46188] New: -fipa-cp removes destructor call jens.maurer at gmx dot net
  2010-10-26 19:08 ` [Bug c++/46188] " pinskia at gcc dot gnu.org
@ 2010-10-26 21:09 ` jens.maurer at gmx dot net
  2010-10-27  6:14 ` jens.maurer at gmx dot net
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: jens.maurer at gmx dot net @ 2010-10-26 21:09 UTC (permalink / raw)
  To: gcc-bugs

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

Jens Maurer <jens.maurer at gmx dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #22164|0                           |1
        is obsolete|                            |

--- Comment #2 from Jens Maurer <jens.maurer at gmx dot net> 2010-10-26 21:09:14 UTC ---
Created attachment 22165
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22165
file to reproduce the bug, now with all aliasing and memory allocation removed

Thanks for your comment.  I've uploaded a new test file that removes all memory
allocations and never ever stores something in this->data, so no aliasing
issues should arise.

Instead of "delete[]", I'm now calling an external function "h".  As usual,
I've removed the .cfi notes from the assembly quotes below.

bad compile:

$ g++  -S playground2.cxx -fverbose-asm -O2

    125         call    g(C const&, C&) #
    126 .LEHE0:
    127         movq    24(%rsp), %rdi  # c2.b_array.data, D.3401
    128         testq   %rdi, %rdi      # D.3401
    129         je      .L9     #,
    130 .LEHB1:
    131         call    h(char*)        #
    132 .LEHE1:
    133 .L9:
    134         movq    16(%rsp), %rdi  # c2.s.adr,
    135 .LEHB2:
    136         call    h(char*)        #
    137 .LEHE2:
    138         addq    $48, %rsp       #,
    141         popq    %rbx    #
    143         ret


good compile:

$ g++  -S playground2.cxx -fverbose-asm -O2 -fno-ipa-cp

    130         call    g(C const&, C&) #
    131 .LEHE0:
    132         movq    8(%rsp), %rbx   # c2.b_array.data, p
    133         testq   %rbx, %rbx      # p
    134         je      .L9     #,
    135         movq    16(%rsp), %r12  # c2.b_array.size, D.3387
    136         testq   %r12, %r12      # D.3387
    137         je      .L10    #,
    138         xorl    %ebp, %ebp      # i
    139         jmp     .L14    #
    140         .p2align 4,,10
    141         .p2align 3
    142 .L22:
    143         addq    $24, %rbx       #, p
    144 .L14:
    145         movq    (%rbx), %rdi    # p->char_array.data, D.3401
    146         testq   %rdi, %rdi      # D.3401
    147         je      .L12    #,
    148 .LEHB1:
    149         call    h(char*)        #
    150 .L12:
    151         addq    $1, %rbp        #, i
    152         cmpq    %rbp, %r12      # i, D.3387
    153         ja      .L22    #,
    154         movq    8(%rsp), %rbx   # c2.b_array.data, p
    155 .L10:
    156         movq    %rbx, %rdi      # p,
    157         call    h(char*)        #
    158 .LEHE1:
    159 .L9:
    160         movq    (%rsp), %rdi    # c2.s.adr,
    161 .LEHB2:
    162         call    h(char*)        #
    163 .LEHE2:
    164         addq    $32, %rsp       #,
    167         popq    %rbx    #
    169         popq    %rbp    #
    171         popq    %r12    #
    173         ret


As can be seen, the destructors on B::char_array are being called (as evidenced
by the loop calling "h"), as opposed to the bad compile, where this does not
happen.  The compile turns good under the same modifications as before.


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

* [Bug c++/46188] -fipa-cp removes destructor call
  2010-10-26 17:05 [Bug c++/46188] New: -fipa-cp removes destructor call jens.maurer at gmx dot net
  2010-10-26 19:08 ` [Bug c++/46188] " pinskia at gcc dot gnu.org
  2010-10-26 21:09 ` jens.maurer at gmx dot net
@ 2010-10-27  6:14 ` jens.maurer at gmx dot net
  2010-10-27  7:55 ` jens.maurer at gmx dot net
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: jens.maurer at gmx dot net @ 2010-10-27  6:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jens Maurer <jens.maurer at gmx dot net> 2010-10-27 06:14:31 UTC ---
Created attachment 22170
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22170
improved testcase

The previous testcase had the problem that the compiler could legitimately
assume that Array::operator= actually left the Array empty, and thus omission
of the destructor calls for the nested Array was actually fine.

I've now added a call to an external function "do_something" at the end of
Array::operator= (which could change the state of the Array as it pleases);
this ought to kill any ideas the compiler might retain about the state of the
Array.

The issue remains reproducible; assembler code essentially unchanged from
above.  Please excuse the confusion.


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

* [Bug c++/46188] -fipa-cp removes destructor call
  2010-10-26 17:05 [Bug c++/46188] New: -fipa-cp removes destructor call jens.maurer at gmx dot net
                   ` (2 preceding siblings ...)
  2010-10-27  6:14 ` jens.maurer at gmx dot net
@ 2010-10-27  7:55 ` jens.maurer at gmx dot net
  2010-10-27 10:31 ` zsojka at seznam dot cz
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: jens.maurer at gmx dot net @ 2010-10-27  7:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jens Maurer <jens.maurer at gmx dot net> 2010-10-27 07:55:37 UTC ---
Created attachment 22171
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22171
two "if" conditions removed from the testcase

Two "if" conditions increase the complexity of the assembler code.  Removing
them doesn't change anything in reproducibility.  So I removed them.


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

* [Bug c++/46188] -fipa-cp removes destructor call
  2010-10-26 17:05 [Bug c++/46188] New: -fipa-cp removes destructor call jens.maurer at gmx dot net
                   ` (3 preceding siblings ...)
  2010-10-27  7:55 ` jens.maurer at gmx dot net
@ 2010-10-27 10:31 ` zsojka at seznam dot cz
  2010-10-27 13:17 ` jens.maurer at gmx dot net
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: zsojka at seznam dot cz @ 2010-10-27 10:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Zdenek Sojka <zsojka at seznam dot cz> 2010-10-27 10:30:35 UTC ---
Created attachment 22172
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22172
the second part of testcase

I used this file to complete your testcase. It defines remaining functions and
prints some debug output. (x86_86-pc-linux-gnu target)

gcc-4.5.2 (r165781)
$ g++ -O2 playground4.cxx playground_main.cxx && ./a.out 
pre-f()
Array<B>::do_something()
h(0x602030)
h((nil))
post-f()
h((nil))
h(0x602010)
h((nil))

$ g++ -O2 -fno-ipa-cp playground4.cxx playground_main.cxx && ./a.out 
pre-f()
Array<B>::do_something()
h((nil))
h(0x602030)
h((nil))
post-f()
h((nil))
h(0x602010)
h((nil))

gcc 4.6.0 (r165985)
$ g++ -O2 playground4.cxx playground_main.cxx && ./a.out 
pre-f()
Array<B>::do_something()
h((nil))
h(0x602030)
h((nil))
post-f()
h((nil))
h(0x602010)
h((nil))

For 4.5 -fipa-cp the output is different. I don't see anything obviously wrong
with the testcase, and valgrind doesn't anyreport any errors. But I am
certainly not an expert.

Apart from this:
#pragma interface
#pragma interface "subdir/objects.h"
    Use this directive in header files that define object classes, to save
space in most of the object files that use those classes.

It's not a header file and #pragma implementation is nowhere... I suppose the
testcase was reduced from preprocessed files.


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

* [Bug c++/46188] -fipa-cp removes destructor call
  2010-10-26 17:05 [Bug c++/46188] New: -fipa-cp removes destructor call jens.maurer at gmx dot net
                   ` (4 preceding siblings ...)
  2010-10-27 10:31 ` zsojka at seznam dot cz
@ 2010-10-27 13:17 ` jens.maurer at gmx dot net
  2010-10-27 13:18 ` jens.maurer at gmx dot net
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: jens.maurer at gmx dot net @ 2010-10-27 13:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jens Maurer <jens.maurer at gmx dot net> 2010-10-27 13:15:19 UTC ---
Thanks.  Yes, the testcase was reduced from preprocessed files.  Unfortunately,
you can't remove the "#pragma interface" without breaking the testcase.  But
the only documented effect that "#pragma interface" should have is that I get
linker errors, i.e. undefined symbols.


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

* [Bug c++/46188] -fipa-cp removes destructor call
  2010-10-26 17:05 [Bug c++/46188] New: -fipa-cp removes destructor call jens.maurer at gmx dot net
                   ` (5 preceding siblings ...)
  2010-10-27 13:17 ` jens.maurer at gmx dot net
@ 2010-10-27 13:18 ` jens.maurer at gmx dot net
  2010-10-27 15:44 ` zsojka at seznam dot cz
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: jens.maurer at gmx dot net @ 2010-10-27 13:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jens Maurer <jens.maurer at gmx dot net> 2010-10-27 13:15:19 UTC ---
Thanks.  Yes, the testcase was reduced from preprocessed files.  Unfortunately,
you can't remove the "#pragma interface" without breaking the testcase.  But
the only documented effect that "#pragma interface" should have is that I get
linker errors, i.e. undefined symbols.


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

* [Bug c++/46188] -fipa-cp removes destructor call
  2010-10-26 17:05 [Bug c++/46188] New: -fipa-cp removes destructor call jens.maurer at gmx dot net
                   ` (6 preceding siblings ...)
  2010-10-27 13:18 ` jens.maurer at gmx dot net
@ 2010-10-27 15:44 ` zsojka at seznam dot cz
  2010-11-10 19:11 ` [Bug c++/46188] [4.5 regression] " jason at gcc dot gnu.org
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: zsojka at seznam dot cz @ 2010-10-27 15:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Zdenek Sojka <zsojka at seznam dot cz> 2010-10-27 15:44:20 UTC ---
Created attachment 22179
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22179
reduced testcase, packed

One header file and two C++ files.

This doesn't use any operator overloading, so should be easier to understand.

Tested revisions:
r165915 - OK
r161659 - OK
r159696 - fail
r158095 - fail
4.5 r165781 - fail
4.5.1 - fail
4.4 r165754 - OK

Good output:
$ g++-4.5.1 pr46188_foo.C pr46188_main.C -O2 -fno-ipa-cp && ./a.out
pre-f()
void Array::foo()
void h(T*) [with T = char] ((nil))
void h(T*) [with T = char] ((nil))
void h(T*) [with T = String] (0x603010)
post-f()

Bad output:
$ g++-4.5.1 pr46188_foo.C pr46188_main.C -O2 && ./a.out
pre-f()
void Array::foo()
void h(T*) [with T = char] ((nil))
void h(T*) [with T = String] (0x603010)
post-f()


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

* [Bug c++/46188] [4.5 regression] -fipa-cp removes destructor call
  2010-10-26 17:05 [Bug c++/46188] New: -fipa-cp removes destructor call jens.maurer at gmx dot net
                   ` (7 preceding siblings ...)
  2010-10-27 15:44 ` zsojka at seznam dot cz
@ 2010-11-10 19:11 ` jason at gcc dot gnu.org
  2010-11-10 23:01 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: jason at gcc dot gnu.org @ 2010-11-10 19:11 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2010.11.10 19:11:20
                 CC|                            |jason at gcc dot gnu.org
      Known to work|                            |4.4.5, 4.6.0
            Summary|-fipa-cp removes destructor |[4.5 regression] -fipa-cp
                   |call                        |removes destructor call
     Ever Confirmed|0                           |1
      Known to fail|                            |4.5.1

--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> 2010-11-10 19:11:20 UTC ---
Confirmed.  Even though size is 1 in ~Array, the inlined form of destruct
assumes that end is 0.  This is first visible in the IPA inline pass.


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

* [Bug c++/46188] [4.5 regression] -fipa-cp removes destructor call
  2010-10-26 17:05 [Bug c++/46188] New: -fipa-cp removes destructor call jens.maurer at gmx dot net
                   ` (8 preceding siblings ...)
  2010-11-10 19:11 ` [Bug c++/46188] [4.5 regression] " jason at gcc dot gnu.org
@ 2010-11-10 23:01 ` rguenth at gcc dot gnu.org
  2010-11-12 14:18 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-11-10 23:01 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jamborm at gcc dot gnu.org
   Target Milestone|---                         |4.5.2


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

* [Bug c++/46188] [4.5 regression] -fipa-cp removes destructor call
  2010-10-26 17:05 [Bug c++/46188] New: -fipa-cp removes destructor call jens.maurer at gmx dot net
                   ` (9 preceding siblings ...)
  2010-11-10 23:01 ` rguenth at gcc dot gnu.org
@ 2010-11-12 14:18 ` rguenth at gcc dot gnu.org
  2010-12-16 13:06 ` [Bug tree-optimization/46188] " rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-11-12 14:18 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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

* [Bug tree-optimization/46188] [4.5 regression] -fipa-cp removes destructor call
  2010-10-26 17:05 [Bug c++/46188] New: -fipa-cp removes destructor call jens.maurer at gmx dot net
                   ` (10 preceding siblings ...)
  2010-11-12 14:18 ` rguenth at gcc dot gnu.org
@ 2010-12-16 13:06 ` rguenth at gcc dot gnu.org
  2011-02-05 15:19 ` mikpe at it dot uu.se
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-12-16 13:06 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.5.2                       |4.5.3

--- Comment #9 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-12-16 13:03:04 UTC ---
GCC 4.5.2 is being released, adjusting target milestone.


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

* [Bug tree-optimization/46188] [4.5 regression] -fipa-cp removes destructor call
  2010-10-26 17:05 [Bug c++/46188] New: -fipa-cp removes destructor call jens.maurer at gmx dot net
                   ` (11 preceding siblings ...)
  2010-12-16 13:06 ` [Bug tree-optimization/46188] " rguenth at gcc dot gnu.org
@ 2011-02-05 15:19 ` mikpe at it dot uu.se
  2011-04-18 14:52 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: mikpe at it dot uu.se @ 2011-02-05 15:19 UTC (permalink / raw)
  To: gcc-bugs

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

Mikael Pettersson <mikpe at it dot uu.se> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu.org,
                   |                            |mikpe at it dot uu.se

--- Comment #10 from Mikael Pettersson <mikpe at it dot uu.se> 2011-02-05 15:19:22 UTC ---
This was fixed for 4.6 by r159907:

Author: hubicka
Date: Thu May 27 02:07:01 2010
New Revision: 159907

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159907
Log:
    * cgraphunit.c (verify_cgraph_node): Do checking that DECL match
    edge only when checking is enabled; check using former_clone_of;
    check inline clones too.
    (cgraph_materialize_clone): Record former_clone_of pointer.
    (cgraph_redirect_edge_call_stmt_to_callee): Assert that we are not
    combining redirections; dump args_to_skip bitmap
    (cgraph_materialize_all_clones): Do no redirection here.
    * ipa-inline.c (inline_transform): Do redirection here.
    * cgraph.h (struct cgraph_node): Add former_clone_of filed (enabled
    cheking only).

See also:
http://gcc.gnu.org/ml/gcc-patches/2010-05/msg02029.html

The patch doesn't apply as-is to 4.5.2 so I haven't checked if it solves the
bug there too.


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

* [Bug tree-optimization/46188] [4.5 regression] -fipa-cp removes destructor call
  2010-10-26 17:05 [Bug c++/46188] New: -fipa-cp removes destructor call jens.maurer at gmx dot net
                   ` (12 preceding siblings ...)
  2011-02-05 15:19 ` mikpe at it dot uu.se
@ 2011-04-18 14:52 ` rguenth at gcc dot gnu.org
  2011-04-18 15:33 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-04-18 14:52 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |44295

--- Comment #11 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-04-18 14:49:48 UTC ---
Depends on fix for PR44295.


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

* [Bug tree-optimization/46188] [4.5 regression] -fipa-cp removes destructor call
  2010-10-26 17:05 [Bug c++/46188] New: -fipa-cp removes destructor call jens.maurer at gmx dot net
                   ` (13 preceding siblings ...)
  2011-04-18 14:52 ` rguenth at gcc dot gnu.org
@ 2011-04-18 15:33 ` rguenth at gcc dot gnu.org
  2011-04-19  9:00 ` rguenth at gcc dot gnu.org
  2011-04-19  9:03 ` rguenth at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-04-18 15:33 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #12 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-04-18 15:31:48 UTC ---
Created attachment 24034
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24034
backport

Testing the attached backport.

I didn't manage to produce a testcase that doesn't use printf.


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

* [Bug tree-optimization/46188] [4.5 regression] -fipa-cp removes destructor call
  2010-10-26 17:05 [Bug c++/46188] New: -fipa-cp removes destructor call jens.maurer at gmx dot net
                   ` (14 preceding siblings ...)
  2011-04-18 15:33 ` rguenth at gcc dot gnu.org
@ 2011-04-19  9:00 ` rguenth at gcc dot gnu.org
  2011-04-19  9:03 ` rguenth at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-04-19  9:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-04-19 08:59:47 UTC ---
Author: rguenth
Date: Tue Apr 19 08:59:45 2011
New Revision: 172698

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172698
Log:
2011-04-19  Richard Guenther  <rguenther@suse.de>

    PR tree-optimization/46188
    Backported from 4.6 branch
    2010-05-26  Jan Hubicka  <jh@suse.cz>

    * cgraphunit.c (clone_of_p): Remove.
    (verify_cgraph_node): Do not verify clones.
    (cgraph_materialize_all_clones): Do no redirection here.
    * ipa-inline.c (inline_transform): Do redirection here.

Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/cgraphunit.c
    branches/gcc-4_5-branch/gcc/ipa-inline.c


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

* [Bug tree-optimization/46188] [4.5 regression] -fipa-cp removes destructor call
  2010-10-26 17:05 [Bug c++/46188] New: -fipa-cp removes destructor call jens.maurer at gmx dot net
                   ` (15 preceding siblings ...)
  2011-04-19  9:00 ` rguenth at gcc dot gnu.org
@ 2011-04-19  9:03 ` rguenth at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-04-19  9:03 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #14 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-04-19 09:00:09 UTC ---
Fixed.


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

end of thread, other threads:[~2011-04-19  9:03 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-26 17:05 [Bug c++/46188] New: -fipa-cp removes destructor call jens.maurer at gmx dot net
2010-10-26 19:08 ` [Bug c++/46188] " pinskia at gcc dot gnu.org
2010-10-26 21:09 ` jens.maurer at gmx dot net
2010-10-27  6:14 ` jens.maurer at gmx dot net
2010-10-27  7:55 ` jens.maurer at gmx dot net
2010-10-27 10:31 ` zsojka at seznam dot cz
2010-10-27 13:17 ` jens.maurer at gmx dot net
2010-10-27 13:18 ` jens.maurer at gmx dot net
2010-10-27 15:44 ` zsojka at seznam dot cz
2010-11-10 19:11 ` [Bug c++/46188] [4.5 regression] " jason at gcc dot gnu.org
2010-11-10 23:01 ` rguenth at gcc dot gnu.org
2010-11-12 14:18 ` rguenth at gcc dot gnu.org
2010-12-16 13:06 ` [Bug tree-optimization/46188] " rguenth at gcc dot gnu.org
2011-02-05 15:19 ` mikpe at it dot uu.se
2011-04-18 14:52 ` rguenth at gcc dot gnu.org
2011-04-18 15:33 ` rguenth at gcc dot gnu.org
2011-04-19  9:00 ` rguenth at gcc dot gnu.org
2011-04-19  9:03 ` rguenth 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).