public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/39188]  New: G++ doesn't handle static anonymous union right
@ 2009-02-14  0:35 hjl dot tools at gmail dot com
  2009-02-14  0:38 ` [Bug c++/39188] " hjl dot tools at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-02-14  0:35 UTC (permalink / raw)
  To: gcc-bugs




-- 
           Summary: G++ doesn't handle static anonymous union right
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hjl dot tools at gmail dot com


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


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

* [Bug c++/39188] G++ doesn't handle static anonymous union right
  2009-02-14  0:35 [Bug c++/39188] New: G++ doesn't handle static anonymous union right hjl dot tools at gmail dot com
@ 2009-02-14  0:38 ` hjl dot tools at gmail dot com
  2009-02-15 19:47 ` hjl dot tools at gmail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-02-14  0:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from hjl dot tools at gmail dot com  2009-02-14 00:38 -------
[hjl@gnu-6 936]$ cat x.cc
#include "foo.h"

int *
x (void)
{
  return f ();
}
[hjl@gnu-6 936]$ cat y.cc
#include <stdio.h>
#include "foo.h"

extern int *x (void);

int
main ()
{
  printf ("%p, %p\n", x (), f ());
  return 0;
}
[hjl@gnu-6 936]$ cat foo.h
inline int *
f ()
{
  static union 
    {
      const char *p;
      int i;
    };
  return &i;
}
[hjl@gnu-6 936]$  g++ x.cc y.cc -O2
[hjl@gnu-6 936]$ ./a.out 
0x600a38, 0x600a40
[hjl@gnu-6 936]$ nm x.o | c++filt 
0000000000000000 W f()
0000000000000000 T x()
0000000000000000 b f()::p
                 U __gxx_personality_v0

f()::p should be global and linkonce.


-- 


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


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

* [Bug c++/39188] G++ doesn't handle static anonymous union right
  2009-02-14  0:35 [Bug c++/39188] New: G++ doesn't handle static anonymous union right hjl dot tools at gmail dot com
  2009-02-14  0:38 ` [Bug c++/39188] " hjl dot tools at gmail dot com
@ 2009-02-15 19:47 ` hjl dot tools at gmail dot com
  2009-02-18 23:46 ` hjl dot tools at gmail dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-02-15 19:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from hjl dot tools at gmail dot com  2009-02-15 19:47 -------
A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2009-02/msg00714.html


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2009-
                   |                            |02/msg00714.html
   Target Milestone|---                         |4.4.0


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


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

* [Bug c++/39188] G++ doesn't handle static anonymous union right
  2009-02-14  0:35 [Bug c++/39188] New: G++ doesn't handle static anonymous union right hjl dot tools at gmail dot com
  2009-02-14  0:38 ` [Bug c++/39188] " hjl dot tools at gmail dot com
  2009-02-15 19:47 ` hjl dot tools at gmail dot com
@ 2009-02-18 23:46 ` hjl dot tools at gmail dot com
  2009-02-19 15:22 ` hjl at gcc dot gnu dot org
  2009-02-19 18:25 ` hjl dot tools at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-02-18 23:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from hjl dot tools at gmail dot com  2009-02-18 23:45 -------
(In reply to comment #2)
> A patch is posted at
> 
> http://gcc.gnu.org/ml/gcc-patches/2009-02/msg00714.html
> 

Jason, Richard, can you review this wrong-code fix? Thanks.


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at redhat dot com,
                   |                            |rguenther at suse dot de


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


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

* [Bug c++/39188] G++ doesn't handle static anonymous union right
  2009-02-14  0:35 [Bug c++/39188] New: G++ doesn't handle static anonymous union right hjl dot tools at gmail dot com
                   ` (2 preceding siblings ...)
  2009-02-18 23:46 ` hjl dot tools at gmail dot com
@ 2009-02-19 15:22 ` hjl at gcc dot gnu dot org
  2009-02-19 18:25 ` hjl dot tools at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: hjl at gcc dot gnu dot org @ 2009-02-19 15:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from hjl at gcc dot gnu dot org  2009-02-19 15:22 -------
Subject: Bug 39188

Author: hjl
Date: Thu Feb 19 15:22:28 2009
New Revision: 144297

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144297
Log:
gcc/

2009-02-19  H.J. Lu  <hongjiu.lu@intel.com>

        PR c++/39188
        * varasm.c (assemble_variable): Don't check DECL_NAME when
        globalizing a variable.

gcc/cp/

2009-02-19  H.J. Lu  <hongjiu.lu@intel.com>

        PR c++/39188
        * cp-tree.h (maybe_commonize_var): New.

        * decl.c (maybe_commonize_var): Make it extern.

        * decl2.c (finish_anon_union): Call maybe_commonize_var.

gcc/testsuite/

2009-02-19  H.J. Lu  <hongjiu.lu@intel.com>

        PR c++/39188
        * g++.dg/abi/pr39188-1a.C: New.
        * g++.dg/abi/pr39188-1b.C: Likewise.
        * g++.dg/abi/pr39188-1.h: Likewise.
        * g++.dg/abi/pr39188-2a.C: Likewise.
        * g++.dg/abi/pr39188-2b.C: Likewise.
        * g++.dg/abi/pr39188-2.h: Likewise.
        * g++.dg/abi/pr39188-3a.C: Likewise.
        * g++.dg/abi/pr39188-3b.C: Likewise.
        * g++.dg/abi/pr39188-3.h: Likewise.

Added:
    trunk/gcc/testsuite/g++.dg/abi/pr39188-1.h
    trunk/gcc/testsuite/g++.dg/abi/pr39188-1a.C
    trunk/gcc/testsuite/g++.dg/abi/pr39188-1b.C
    trunk/gcc/testsuite/g++.dg/abi/pr39188-2.h
    trunk/gcc/testsuite/g++.dg/abi/pr39188-2a.C
    trunk/gcc/testsuite/g++.dg/abi/pr39188-2b.C
    trunk/gcc/testsuite/g++.dg/abi/pr39188-3.h
    trunk/gcc/testsuite/g++.dg/abi/pr39188-3a.C
    trunk/gcc/testsuite/g++.dg/abi/pr39188-3b.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/decl2.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/varasm.c


-- 


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


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

* [Bug c++/39188] G++ doesn't handle static anonymous union right
  2009-02-14  0:35 [Bug c++/39188] New: G++ doesn't handle static anonymous union right hjl dot tools at gmail dot com
                   ` (3 preceding siblings ...)
  2009-02-19 15:22 ` hjl at gcc dot gnu dot org
@ 2009-02-19 18:25 ` hjl dot tools at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-02-19 18:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from hjl dot tools at gmail dot com  2009-02-19 18:25 -------
Fixed.


-- 

hjl dot tools at gmail dot com changed:

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


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


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

end of thread, other threads:[~2009-02-19 18:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-14  0:35 [Bug c++/39188] New: G++ doesn't handle static anonymous union right hjl dot tools at gmail dot com
2009-02-14  0:38 ` [Bug c++/39188] " hjl dot tools at gmail dot com
2009-02-15 19:47 ` hjl dot tools at gmail dot com
2009-02-18 23:46 ` hjl dot tools at gmail dot com
2009-02-19 15:22 ` hjl at gcc dot gnu dot org
2009-02-19 18:25 ` hjl dot 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).