public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/49378] New: [4.7 Regression] C++ is broken
@ 2011-06-12  1:02 hjl.tools at gmail dot com
  2011-06-12  1:15 ` [Bug c++/49378] " hjl.tools at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2011-06-12  1:02 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: [4.7 Regression] C++ is broken
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: hjl.tools@gmail.com


On Fedora 15/x86-64, revision 174953 failed most of C++ testcase
for 32bit:

http://gcc.gnu.org/ml/gcc-testresults/2011-06/msg01336.html

(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y

Starting program: /export/home/hjl/tmp/bad 

Program received signal SIGSEGV, Segmentation fault.
0x0018d7b8 in (anonymous
namespace)::future_error_category::~future_error_category (this=0x18d7a0,
__in_chrg=<optimized out>)
    at /export/gnu/import/git/gcc/libstdc++-v3/src/future.cc:29
29      struct future_error_category : public std::error_category
(gdb) bt
#0  0x0018d7b8 in (anonymous
namespace)::future_error_category::~future_error_category (this=0x18d7a0,
__in_chrg=<optimized out>)
    at /export/gnu/import/git/gcc/libstdc++-v3/src/future.cc:29
#1  0x00295ec7 in __cxa_finalize () from /lib/libc.so.6
#2  0x001767c4 in __do_global_dtors_aux () from /tmp/libstdc++.so.6
#3  0x001ea860 in _fini () from /tmp/libstdc++.so.6
#4  0x0011f2fd in _dl_fini () from /lib/ld-linux.so.2
#5  0x00295b31 in __run_exit_handlers () from /lib/libc.so.6
#6  0x00295bbd in exit () from /lib/libc.so.6
#7  0x0027d41b in __libc_start_main () from /lib/libc.so.6
#8  0x08048ce1 in _start ()
(gdb) disass
Dump of assembler code for function (anonymous
namespace)::future_error_category::~future_error_category():
   0x0018d7a0 <+0>:    push   %ebx
   0x0018d7a1 <+1>:    call   0x176847 <__i686.get_pc_thunk.bx>
   0x0018d7a6 <+6>:    add    $0x8784e,%ebx
   0x0018d7ac <+12>:    sub    $0x18,%esp
   0x0018d7af <+15>:    mov    %eax,(%esp)
   0x0018d7b2 <+18>:    lea    -0x2bcc(%ebx),%edx
=> 0x0018d7b8 <+24>:    mov    %edx,(%eax)
   0x0018d7ba <+26>:    call   0x173b4c <_ZNSt14error_categoryD2Ev@plt>
   0x0018d7bf <+31>:    add    $0x18,%esp
   0x0018d7c2 <+34>:    pop    %ebx
   0x0018d7c3 <+35>:    ret    
End of assembler dump.
(gdb) 

EAX is never initialized.


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

* [Bug c++/49378] [4.7 Regression] C++ is broken
  2011-06-12  1:02 [Bug c++/49378] New: [4.7 Regression] C++ is broken hjl.tools at gmail dot com
@ 2011-06-12  1:15 ` hjl.tools at gmail dot com
  2011-06-12  1:17 ` [Bug middle-end/49378] " hjl.tools at gmail dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2011-06-12  1:15 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu.org

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2011-06-12 01:15:03 UTC ---
Revision 174951 is OK.  Revision 174952:

http://gcc.gnu.org/ml/gcc-cvs/2011-06/msg00441.html

is the cause.


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

* [Bug middle-end/49378] [4.7 Regression] C++ is broken
  2011-06-12  1:02 [Bug c++/49378] New: [4.7 Regression] C++ is broken hjl.tools at gmail dot com
  2011-06-12  1:15 ` [Bug c++/49378] " hjl.tools at gmail dot com
@ 2011-06-12  1:17 ` hjl.tools at gmail dot com
  2011-06-12 13:37 ` hjl.tools at gmail dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2011-06-12  1:17 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |middle-end
   Target Milestone|---                         |4.7.0


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

* [Bug middle-end/49378] [4.7 Regression] C++ is broken
  2011-06-12  1:02 [Bug c++/49378] New: [4.7 Regression] C++ is broken hjl.tools at gmail dot com
  2011-06-12  1:15 ` [Bug c++/49378] " hjl.tools at gmail dot com
  2011-06-12  1:17 ` [Bug middle-end/49378] " hjl.tools at gmail dot com
@ 2011-06-12 13:37 ` hjl.tools at gmail dot com
  2011-06-12 14:42 ` hubicka at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2011-06-12 13:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> 2011-06-12 13:36:39 UTC ---
On x86-64, I got

000000000006d270 <_ZN12_GLOBAL__N_121system_error_categoryD0Ev>:
   6d270:       48 8d 05 79 d4 27 00    lea    0x27d479(%rip),%rax        #
2ea6f0 <_ZTVN12_GLOBAL__N_121system_error_categoryE+0x10>
   6d277:       53                      push   %rbx
   6d278:       48 89 fb                mov    %rdi,%rbx
   6d27b:       48 89 07                mov    %rax,(%rdi)
   6d27e:       e8 55 a0 fe ff          callq  572d8
<_ZNSt14error_categoryD2Ev@plt>
   6d283:       48 89 df                mov    %rbx,%rdi
   6d286:       5b                      pop    %rbx
   6d287:       e9 2c 9d fe ff          jmpq   56fb8 <_ZdlPv@plt>
   6d28c:       90                      nop
   6d28d:       90                      nop
   6d28e:       90                      nop
   6d28f:       90                      nop

RAX is also uninitialized.


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

* [Bug middle-end/49378] [4.7 Regression] C++ is broken
  2011-06-12  1:02 [Bug c++/49378] New: [4.7 Regression] C++ is broken hjl.tools at gmail dot com
                   ` (2 preceding siblings ...)
  2011-06-12 13:37 ` hjl.tools at gmail dot com
@ 2011-06-12 14:42 ` hubicka at gcc dot gnu.org
  2011-06-12 14:51 ` hjl.tools at gmail dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-06-12 14:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-06-12 14:41:18 UTC ---
Hi,
looks like I have the lucky kernel. 

I think the problem is that we now mark as local thunks that are not having
address taken that makes i386 BE to use register passing conventions.

Does the following patch help?

Index: ipa.c
===================================================================
--- ipa.c       (revision 174958)
+++ ipa.c       (working copy)
@@ -120,6 +120,7 @@ static bool
 cgraph_non_local_node_p_1 (struct cgraph_node *node, void *data
ATTRIBUTE_UNUSED)
 {
    return !(cgraph_only_called_directly_or_aliased_p (node)
+           && !ipa_ref_has_aliases_p (&node->ref_list)
            && node->analyzed
            && !DECL_EXTERNAL (node->decl)
            && !node->local.externally_visible
@@ -132,7 +133,11 @@ cgraph_non_local_node_p_1 (struct cgraph
 static bool
 cgraph_local_node_p (struct cgraph_node *node)
 {
-   return !cgraph_for_node_and_aliases (cgraph_function_or_thunk_node (node,
NULL),
+   struct cgraph_node *n = cgraph_function_or_thunk_node (node, NULL);
+   
+   if (n->thunk.thunk_p)
+     return false;
+   return !cgraph_for_node_and_aliases (n,
                                        cgraph_non_local_node_p_1, NULL, true);

 }


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

* [Bug middle-end/49378] [4.7 Regression] C++ is broken
  2011-06-12  1:02 [Bug c++/49378] New: [4.7 Regression] C++ is broken hjl.tools at gmail dot com
                   ` (3 preceding siblings ...)
  2011-06-12 14:42 ` hubicka at gcc dot gnu.org
@ 2011-06-12 14:51 ` hjl.tools at gmail dot com
  2011-06-12 15:15 ` hjl.tools at gmail dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2011-06-12 14:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> 2011-06-12 14:51:12 UTC ---
(In reply to comment #3)
> Hi,
> looks like I have the lucky kernel. 
> 
> I think the problem is that we now mark as local thunks that are not having
> address taken that makes i386 BE to use register passing conventions.
> 
> Does the following patch help?
> 

Can you upload the patch as an attachment? It is hard to apply
it as a comment. Thanks.


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

* [Bug middle-end/49378] [4.7 Regression] C++ is broken
  2011-06-12  1:02 [Bug c++/49378] New: [4.7 Regression] C++ is broken hjl.tools at gmail dot com
                   ` (4 preceding siblings ...)
  2011-06-12 14:51 ` hjl.tools at gmail dot com
@ 2011-06-12 15:15 ` hjl.tools at gmail dot com
  2011-06-12 16:39 ` hubicka at gcc dot gnu.org
  2011-06-23 14:10 ` hjl.tools at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2011-06-12 15:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> 2011-06-12 15:15:09 UTC ---
Created attachment 24502
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24502
Preprocessed 32bit future.cc


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

* [Bug middle-end/49378] [4.7 Regression] C++ is broken
  2011-06-12  1:02 [Bug c++/49378] New: [4.7 Regression] C++ is broken hjl.tools at gmail dot com
                   ` (5 preceding siblings ...)
  2011-06-12 15:15 ` hjl.tools at gmail dot com
@ 2011-06-12 16:39 ` hubicka at gcc dot gnu.org
  2011-06-23 14:10 ` hjl.tools at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-06-12 16:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-06-12 16:39:41 UTC ---
Author: hubicka
Date: Sun Jun 12 16:39:38 2011
New Revision: 174969

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174969
Log:
    PR middle-end/49378
    * ipa.c (cgraph_non_local_node_p_1, cgraph_local_node_p): Rule out
    aliases and thunks.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ipa.c


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

* [Bug middle-end/49378] [4.7 Regression] C++ is broken
  2011-06-12  1:02 [Bug c++/49378] New: [4.7 Regression] C++ is broken hjl.tools at gmail dot com
                   ` (6 preceding siblings ...)
  2011-06-12 16:39 ` hubicka at gcc dot gnu.org
@ 2011-06-23 14:10 ` hjl.tools at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2011-06-23 14:10 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

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

--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> 2011-06-23 14:10:02 UTC ---
Fixed.


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

end of thread, other threads:[~2011-06-23 14:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-12  1:02 [Bug c++/49378] New: [4.7 Regression] C++ is broken hjl.tools at gmail dot com
2011-06-12  1:15 ` [Bug c++/49378] " hjl.tools at gmail dot com
2011-06-12  1:17 ` [Bug middle-end/49378] " hjl.tools at gmail dot com
2011-06-12 13:37 ` hjl.tools at gmail dot com
2011-06-12 14:42 ` hubicka at gcc dot gnu.org
2011-06-12 14:51 ` hjl.tools at gmail dot com
2011-06-12 15:15 ` hjl.tools at gmail dot com
2011-06-12 16:39 ` hubicka at gcc dot gnu.org
2011-06-23 14:10 ` hjl.tools 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).