public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/50620] New: "undefined reference" errors / csmith lto testing
@ 2011-10-05 12:19 markus at trippelsdorf dot de
  2011-10-09 13:29 ` [Bug lto/50620] " hubicka at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: markus at trippelsdorf dot de @ 2011-10-05 12:19 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50620
           Summary: "undefined reference" errors / csmith lto testing
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: markus@trippelsdorf.de


Created attachment 25421
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25421
preprocessed testfile

I ran csmith's compiler_test.pl ( http://embed.cs.utah.edu/csmith/ ) overnight:

 % cat compiler_test
gcc -O2 -Wfatal-errors -w -flto
 % compiler_test.pl 0 compiler_test
...

This produces roughly one "crash" file every 20 minutes. All files show
linker errors of the same type e.g.:

 % gcc -O2 -Wfatal-errors -w -flto test.i
/tmp/ccYdYNxC.ltrans1.ltrans.o:ccYdYNxC.ltrans1.o:function func_1.2254: error:
undefined reference to 'g_331.2321.2276'
collect2: error: ld returned 1 exit status

Running without "-flto" or adding "-flto-partition=1to1" resolves the issue.

I've attached one preprocessed file, that was reduced with delta.


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

* [Bug lto/50620] "undefined reference" errors / csmith lto testing
  2011-10-05 12:19 [Bug lto/50620] New: "undefined reference" errors / csmith lto testing markus at trippelsdorf dot de
@ 2011-10-09 13:29 ` hubicka at gcc dot gnu.org
  2011-10-09 14:34 ` andi-gcc at firstfloor dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-10-09 13:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #1 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-10-09 13:28:40 UTC ---
The problem here is different than one in PR50620.
What happens is that we ship constructors of const static variables into every
partition that reffers to that to aid possible folding of loads from the var.
The constructor of variable pointing to g_331 gets shipped to ltrans1 even when
it is otherwise in other partition. Eventually we fold and place direct
reference to g_331 into code, but the logic promoting symbols hidden doesn't
really consider this posibility, so we end up with undefined reference.

I guess the whole promotion code will need some cleanups and updating - first
the logic is all duplicated in between lto.c and lto-cgraph.c and it is O(n^2),
and second it is not really easy to tweak it to solve this problem - it is
based on the fact that only funcions/variable sin the partition may cause
promotion, while the variable pointing to g_331 is not in ltrans1.

Honza


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

* [Bug lto/50620] "undefined reference" errors / csmith lto testing
  2011-10-05 12:19 [Bug lto/50620] New: "undefined reference" errors / csmith lto testing markus at trippelsdorf dot de
  2011-10-09 13:29 ` [Bug lto/50620] " hubicka at gcc dot gnu.org
@ 2011-10-09 14:34 ` andi-gcc at firstfloor dot org
  2012-05-07 13:04 ` rguenth at gcc dot gnu.org
  2012-06-05 16:05 ` markus at trippelsdorf dot de
  3 siblings, 0 replies; 5+ messages in thread
From: andi-gcc at firstfloor dot org @ 2011-10-09 14:34 UTC (permalink / raw)
  To: gcc-bugs

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

Andi Kleen <andi-gcc at firstfloor dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andi-gcc at firstfloor dot
                   |                            |org

--- Comment #2 from Andi Kleen <andi-gcc at firstfloor dot org> 2011-10-09 14:33:18 UTC ---
I see a similar problem in a large LTO build
(at least Honza thinks it's the same)


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

* [Bug lto/50620] "undefined reference" errors / csmith lto testing
  2011-10-05 12:19 [Bug lto/50620] New: "undefined reference" errors / csmith lto testing markus at trippelsdorf dot de
  2011-10-09 13:29 ` [Bug lto/50620] " hubicka at gcc dot gnu.org
  2011-10-09 14:34 ` andi-gcc at firstfloor dot org
@ 2012-05-07 13:04 ` rguenth at gcc dot gnu.org
  2012-06-05 16:05 ` markus at trippelsdorf dot de
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-05-07 13:04 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-05-07
     Ever Confirmed|0                           |1

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-05-07 13:01:48 UTC ---
Confirmed by comment #1


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

* [Bug lto/50620] "undefined reference" errors / csmith lto testing
  2011-10-05 12:19 [Bug lto/50620] New: "undefined reference" errors / csmith lto testing markus at trippelsdorf dot de
                   ` (2 preceding siblings ...)
  2012-05-07 13:04 ` rguenth at gcc dot gnu.org
@ 2012-06-05 16:05 ` markus at trippelsdorf dot de
  3 siblings, 0 replies; 5+ messages in thread
From: markus at trippelsdorf dot de @ 2012-06-05 16:05 UTC (permalink / raw)
  To: gcc-bugs

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

Markus Trippelsdorf <markus at trippelsdorf dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
            Version|4.7.0                       |4.8.0
         Resolution|                            |FIXED

--- Comment #4 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-06-05 16:04:46 UTC ---
Fixed in 4.8.0


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

end of thread, other threads:[~2012-06-05 16:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-05 12:19 [Bug lto/50620] New: "undefined reference" errors / csmith lto testing markus at trippelsdorf dot de
2011-10-09 13:29 ` [Bug lto/50620] " hubicka at gcc dot gnu.org
2011-10-09 14:34 ` andi-gcc at firstfloor dot org
2012-05-07 13:04 ` rguenth at gcc dot gnu.org
2012-06-05 16:05 ` markus at trippelsdorf dot de

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).