public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/64860] [5 Regression] multiple definition of typeinfo in 5.0 (4.9.2 works)
       [not found] <bug-64860-4@http.gcc.gnu.org/bugzilla/>
@ 2015-01-29 15:27 ` rguenth at gcc dot gnu.org
  2015-01-29 15:27 ` [Bug lto/64860] " rguenth at gcc dot gnu.org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-01-29 15:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64860

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |lto, wrong-code
      Known to work|                            |4.9.2
   Target Milestone|---                         |5.0
            Summary|multiple definition of      |[5 Regression] multiple
                   |typeinfo in 5.0 (4.9.2      |definition of typeinfo in
                   |works)                      |5.0 (4.9.2 works)


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

* [Bug lto/64860] multiple definition of typeinfo in 5.0 (4.9.2 works)
       [not found] <bug-64860-4@http.gcc.gnu.org/bugzilla/>
  2015-01-29 15:27 ` [Bug lto/64860] [5 Regression] multiple definition of typeinfo in 5.0 (4.9.2 works) rguenth at gcc dot gnu.org
@ 2015-01-29 15:27 ` rguenth at gcc dot gnu.org
  2015-02-01 18:49 ` [Bug lto/64860] [5 Regression] " hubicka at gcc dot gnu.org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-01-29 15:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64860

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

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

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Honza?


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

* [Bug lto/64860] [5 Regression] multiple definition of typeinfo in 5.0 (4.9.2 works)
       [not found] <bug-64860-4@http.gcc.gnu.org/bugzilla/>
  2015-01-29 15:27 ` [Bug lto/64860] [5 Regression] multiple definition of typeinfo in 5.0 (4.9.2 works) rguenth at gcc dot gnu.org
  2015-01-29 15:27 ` [Bug lto/64860] " rguenth at gcc dot gnu.org
@ 2015-02-01 18:49 ` hubicka at gcc dot gnu.org
  2015-02-02  6:31 ` hubicka at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: hubicka at gcc dot gnu.org @ 2015-02-01 18:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64860

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2015-02-01
           Assignee|unassigned at gcc dot gnu.org      |hubicka at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #2 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Mine


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

* [Bug lto/64860] [5 Regression] multiple definition of typeinfo in 5.0 (4.9.2 works)
       [not found] <bug-64860-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2015-02-01 18:49 ` [Bug lto/64860] [5 Regression] " hubicka at gcc dot gnu.org
@ 2015-02-02  6:31 ` hubicka at gcc dot gnu.org
  2015-03-18 12:53 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: hubicka at gcc dot gnu.org @ 2015-02-02  6:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64860

--- Comment #3 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Hmm, interesting, I did not even think we support this ;)
I am not sure how much it makes sense to do incremntal linking like this with
LTO because this limits LTO to incremental link only (it would perhaps make
sense to produce LTO file after merigng in this case).

What changed since GCC 4.9 is that visibility pass is now more aggressive on
bringing comdat locals.  In resolution file we have:
$ more *.res
1
file2.o 6
212 f6705eca5fa850e3 PREVAILING_DEF _ZN11CDialogBase11GetDocumentEv
217 f6705eca5fa850e3 PREVAILING_DEF dialog2
204 f6705eca5fa850e3 PREVAILING_DEF _ZTV11CDialogBase
232 f6705eca5fa850e3 PREVAILING_DEF _ZTS11CDialogBase
248 f6705eca5fa850e3 PREVAILING_DEF _ZTI11CDialogBase
259 f6705eca5fa850e3 UNDEF _ZTVN10__cxxabiv117__class_type_infoE

which makes us to believe that all the symbols are previaling ones for current
DSO.  The trick it that incrementally this is not quite true. I suppose only
way to make this work reliably is to modify:
static bool                                                                     
resolution_to_local_definition_p (enum ld_plugin_symbol_resolution resolution)  
{                                                                               
  return (resolution == LDPR_PREVAILING_DEF                                     
          || resolution == LDPR_PREVAILING_DEF_IRONLY_EXP                       
          || resolution == LDPR_PREVAILING_DEF_IRONLY);                         
}                                                                               
to exclude LDPR_PREVAILING_DEF and similarly in ipa.c.  This way we lose some
optimization in non-incremental linking where we know that we are the only LTO
unit in proram.

So perhaps doing this conditionally on -r? We will probably makes it funnier to
produce testcases. Or we don't really care as it normally affects only cases
where non-LTO and LTO objects are mixed.


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

* [Bug lto/64860] [5 Regression] multiple definition of typeinfo in 5.0 (4.9.2 works)
       [not found] <bug-64860-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2015-02-02  6:31 ` hubicka at gcc dot gnu.org
@ 2015-03-18 12:53 ` rguenth at gcc dot gnu.org
  2015-03-18 18:30 ` hubicka at gcc dot gnu.org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-03-18 12:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64860

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Yes, -r should be honored by the appropriate resolution info (not _IR_ONLY). 
Thus you have to treat that conservatively.

Otherwise you can create a testcase that fails with the final link and the
other strong definition in a shared library.


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

* [Bug lto/64860] [5 Regression] multiple definition of typeinfo in 5.0 (4.9.2 works)
       [not found] <bug-64860-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2015-03-18 12:53 ` rguenth at gcc dot gnu.org
@ 2015-03-18 18:30 ` hubicka at gcc dot gnu.org
  2015-03-18 18:33 ` hubicka at gcc dot gnu.org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: hubicka at gcc dot gnu.org @ 2015-03-18 18:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64860

--- Comment #5 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Well, the problem is that -r is the only case where we get LDPR_PREVAILING_DEF
or IRONLY and the resulting symbol may be removed from the unit later.
We would need a new LDPR_PREVAILING_DEF_FOR_NOW or something like that to
represent the incremental nature of linking here, or we need a global flag in
GCC saying if incremental linking is supposed tohappen or not.


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

* [Bug lto/64860] [5 Regression] multiple definition of typeinfo in 5.0 (4.9.2 works)
       [not found] <bug-64860-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2015-03-18 18:30 ` hubicka at gcc dot gnu.org
@ 2015-03-18 18:33 ` hubicka at gcc dot gnu.org
  2015-03-23  4:33 ` hubicka at gcc dot gnu.org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: hubicka at gcc dot gnu.org @ 2015-03-18 18:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64860

--- Comment #6 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
(just to explain bit more - the main difference between static and dynamic
linking here is that dynamic linking never remove any definition and thus you
can dissolve comdat groups)


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

* [Bug lto/64860] [5 Regression] multiple definition of typeinfo in 5.0 (4.9.2 works)
       [not found] <bug-64860-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2015-03-18 18:33 ` hubicka at gcc dot gnu.org
@ 2015-03-23  4:33 ` hubicka at gcc dot gnu.org
  2015-03-27 14:48 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: hubicka at gcc dot gnu.org @ 2015-03-23  4:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64860

--- Comment #8 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Created attachment 35100
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35100&action=edit
partial patch

Hi,
this is a patch that adds necessary checks into resolution code. Basically if
static linking is anticipated, we can not derive much of useful info from
PREVAILING_DEF/PREVAILING_DEF_IRONLY_EXP and must anticipate that static
linking may change these and drop comdat groups.

THe catch is that someone needs to pass -r to lto1 that is not currently
happening (I verified that if I hack opts.c to set incremental_linking to true
the testcase works).

With -r option, I can imagine that lto-wrapper can do it, because we get:
COLLECT_GCC_OPTIONS='-c' '-fmath-errno' '-fsigned-zeros' '-ftrapping-math'
'-fno-trapv' '-fno-openmp' '-fno-openacc' '-mtune=generic' '-march=x86-64'
'-O2' '-B' './' '-O2' '-r' '-v' '-mtune=generic' '-march=x86-64'
'-fltrans-output-list=/tmp/cc3o3UIr.ltrans.out' '-fwpa'
'-fresolution=/tmp/cchYXuvF.res

I donot know hwere -r gets dropped though.  But the testcase uses -Wl,-r that
may need LTO plugin extension?


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

* [Bug lto/64860] [5 Regression] multiple definition of typeinfo in 5.0 (4.9.2 works)
       [not found] <bug-64860-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2015-03-23  4:33 ` hubicka at gcc dot gnu.org
@ 2015-03-27 14:48 ` jakub at gcc dot gnu.org
  2015-03-30  7:29 ` hubicka at gcc dot gnu.org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-27 14:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64860

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P2
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Lowering to P2 on Honza's request.


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

* [Bug lto/64860] [5 Regression] multiple definition of typeinfo in 5.0 (4.9.2 works)
       [not found] <bug-64860-4@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2015-03-27 14:48 ` jakub at gcc dot gnu.org
@ 2015-03-30  7:29 ` hubicka at gcc dot gnu.org
  2015-04-22 12:06 ` [Bug lto/64860] [5/6 " jakub at gcc dot gnu.org
  2015-07-16  9:20 ` rguenth at gcc dot gnu.org
  11 siblings, 0 replies; 12+ messages in thread
From: hubicka at gcc dot gnu.org @ 2015-03-30  7:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64860

--- Comment #10 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
I filled in binutils PR for extension of plugin API
https://sourceware.org/bugzilla/show_bug.cgi?id=18178


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

* [Bug lto/64860] [5/6 Regression] multiple definition of typeinfo in 5.0 (4.9.2 works)
       [not found] <bug-64860-4@http.gcc.gnu.org/bugzilla/>
                   ` (9 preceding siblings ...)
  2015-03-30  7:29 ` hubicka at gcc dot gnu.org
@ 2015-04-22 12:06 ` jakub at gcc dot gnu.org
  2015-07-16  9:20 ` rguenth at gcc dot gnu.org
  11 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-04-22 12:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64860

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|5.0                         |5.2

--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 5.1 has been released.


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

* [Bug lto/64860] [5/6 Regression] multiple definition of typeinfo in 5.0 (4.9.2 works)
       [not found] <bug-64860-4@http.gcc.gnu.org/bugzilla/>
                   ` (10 preceding siblings ...)
  2015-04-22 12:06 ` [Bug lto/64860] [5/6 " jakub at gcc dot gnu.org
@ 2015-07-16  9:20 ` rguenth at gcc dot gnu.org
  11 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-07-16  9:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64860

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|5.2                         |5.3

--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 5.2 is being released, adjusting target milestone to 5.3.


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

end of thread, other threads:[~2015-07-16  9:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-64860-4@http.gcc.gnu.org/bugzilla/>
2015-01-29 15:27 ` [Bug lto/64860] [5 Regression] multiple definition of typeinfo in 5.0 (4.9.2 works) rguenth at gcc dot gnu.org
2015-01-29 15:27 ` [Bug lto/64860] " rguenth at gcc dot gnu.org
2015-02-01 18:49 ` [Bug lto/64860] [5 Regression] " hubicka at gcc dot gnu.org
2015-02-02  6:31 ` hubicka at gcc dot gnu.org
2015-03-18 12:53 ` rguenth at gcc dot gnu.org
2015-03-18 18:30 ` hubicka at gcc dot gnu.org
2015-03-18 18:33 ` hubicka at gcc dot gnu.org
2015-03-23  4:33 ` hubicka at gcc dot gnu.org
2015-03-27 14:48 ` jakub at gcc dot gnu.org
2015-03-30  7:29 ` hubicka at gcc dot gnu.org
2015-04-22 12:06 ` [Bug lto/64860] [5/6 " jakub at gcc dot gnu.org
2015-07-16  9:20 ` 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).