public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/54709] New: [4.8 Regression] r191713 breaks Firefox build
@ 2012-09-25 16:05 markus at trippelsdorf dot de
  2012-09-26  9:27 ` [Bug lto/54709] " rguenth at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: markus at trippelsdorf dot de @ 2012-09-25 16:05 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 54709
           Summary: [4.8 Regression] r191713 breaks Firefox build
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: markus@trippelsdorf.de


r191713 thankfully fixed lto/profiledbootstrap, but building lto/profiled
Firefox is broken because of this fix right now:

...
gcc -shared -Wl,-soname -Wl,libnspr4.so -o libnspr4.so ./prvrsion.o
io/./prfdcach.o io/./prmwait.o io/./prmapopt.o io/./priometh.o io/./pripv6.o
io/.
/prlayer.o io/./prlog.o io/./prmmap.o io/./prpolevt.o io/./prprf.o
io/./prscanf.o io/./prstdio.o threads/./prcmon.o threads/./prrwlock.o
threads/./pr
tpd.o linking/./prlink.o malloc/./prmalloc.o malloc/./prmem.o md/./prosdep.o
memory/./prshm.o memory/./prshma.o memory/./prseg.o misc/./pralarm.o mis
c/./pratom.o misc/./prcountr.o misc/./prdtoa.o misc/./prenv.o misc/./prerr.o
misc/./prerror.o misc/./prerrortable.o misc/./prinit.o misc/./prinrval.o
 misc/./pripc.o misc/./prlog2.o misc/./prlong.o misc/./prnetdb.o
misc/./praton.o misc/./prolock.o misc/./prrng.o misc/./prsystem.o
misc/./prthinfo.o 
misc/./prtpool.o misc/./prtrace.o misc/./prtime.o pthreads/./ptsynch.o
pthreads/./ptio.o pthreads/./ptthread.o pthreads/./ptmisc.o md/unix/./unix.o m
d/unix/./unix_errors.o md/unix/./uxproces.o md/unix/./uxrng.o md/unix/./uxshm.o
md/unix/./uxwrap.o md/unix/./linux.o md/unix/./os_Linux_x86_64.o  -fu
se-linker-plugin -Wl,-O1,--hash-style=gnu,--no-keep-memory  -fprofile-use 
-lpthread -ldl
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccdZgGDF.ltrans0.ltrans.o: requires dynamic R_X86_64_PC32 
reloc against 'strlen' which may overflow at runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccdZgGDF.ltrans1.ltrans.o: requires dynamic R_X86_64_PC32 
reloc against 'strncmp' which may overflow at runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccdZgGDF.ltrans2.ltrans.o: requires dynamic R_X86_64_PC32 
reloc against 'strlen' which may overflow at runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccdZgGDF.ltrans3.ltrans.o: requires dynamic R_X86_64_PC32 
reloc against 'memset' which may overflow at runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccdZgGDF.ltrans7.ltrans.o: requires dynamic R_X86_64_PC32 
reloc against 'strlen' which may overflow at runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccdZgGDF.ltrans8.ltrans.o: requires dynamic R_X86_64_PC32 
reloc against 'memset' which may overflow at runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccdZgGDF.ltrans10.ltrans.o: requires dynamic R_X86_64_PC32
 reloc against 'strcpy' which may overflow at runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccdZgGDF.ltrans11.ltrans.o: requires dynamic R_X86_64_PC32
 reloc against 'memcpy' which may overflow at runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccdZgGDF.ltrans12.ltrans.o: requires dynamic R_X86_64_PC32
 reloc against 'memset' which may overflow at runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccdZgGDF.ltrans13.ltrans.o: requires dynamic R_X86_64_PC32
 reloc against 'memcpy' which may overflow at runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccdZgGDF.ltrans14.ltrans.o: requires dynamic R_X86_64_PC32
 reloc against 'memcpy' which may overflow at runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccdZgGDF.ltrans15.ltrans.o: requires dynamic R_X86_64_PC32
 reloc against 'memcpy' which may overflow at runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccdZgGDF.ltrans16.ltrans.o: requires dynamic R_X86_64_PC32
 reloc against 'free' which may overflow at runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccdZgGDF.ltrans17.ltrans.o: requires dynamic R_X86_64_PC32
 reloc against 'strlen' which may overflow at runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccdZgGDF.ltrans18.ltrans.o: requires dynamic R_X86_64_PC32
 reloc against 'strlen' which may overflow at runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccdZgGDF.ltrans19.ltrans.o: requires dynamic R_X86_64_PC32
 reloc against 'strlen' which may overflow at runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccdZgGDF.ltrans20.ltrans.o: requires dynamic R_X86_64_PC32
 reloc against 'memcpy' which may overflow at runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccdZgGDF.ltrans21.ltrans.o: requires dynamic R_X86_64_PC32
 reloc against 'memcpy' which may overflow at runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccdZgGDF.ltrans22.ltrans.o: requires dynamic R_X86_64_PC32
 reloc against 'memcpy' which may overflow at runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: hidden symbol 'strlen' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: hidden symbol 'strcpy' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: hidden symbol 'strncmp' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: hidden symbol '_exit' is not defined locally
... etc.

Reduced to:

arkus@x4 moz_testcase % cat test1.i
foo ()
{
    memcpy (0, 1, 1);
}

markus@x4 moz_testcase % cat test2.i
* memcpy (void *, void *, long);
bar ()
{
    memcpy (0, 1, 1);
}

markus@x4 moz_testcase % gcc -w -fPIC -shared -fvisibility=hidden -O0 -flto
test1.i test2.i
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccyZYF4P.ltrans0.ltrans.o: requires dynamic R_X86_64_PC32 reloc
against 'memcpy' which may overflow at runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: hidden symbol 'memcpy' is not defined locally
collect2: error: ld returned 1 exit status
(output from gold)

markus@x4 moz_testcase % gcc -w -fPIC -shared -fvisibility=hidden -O0 -flto
test1.i test2.i
/tmp/ccpZAInI.ltrans0.ltrans.o: In function `bar.2365':
ccpZAInI.ltrans0.o:(.text+0x29): undefined reference to `memcpy'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
a.out: hidden symbol `memcpy' isn't defined
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:
final link failed: Bad value
collect2: error: ld returned 1 exit status
(output from ld.bfd)


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

* [Bug lto/54709] [4.8 Regression] r191713 breaks Firefox build
  2012-09-25 16:05 [Bug lto/54709] New: [4.8 Regression] r191713 breaks Firefox build markus at trippelsdorf dot de
@ 2012-09-26  9:27 ` rguenth at gcc dot gnu.org
  2012-09-26 10:11 ` rguenth at gcc dot gnu.org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-09-26  9:27 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
           Keywords|                            |lto
   Last reconfirmed|                            |2012-09-26
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1
   Target Milestone|---                         |4.8.0

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-26 09:26:52 UTC ---
Confirmed.  I'll have a look.


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

* [Bug lto/54709] [4.8 Regression] r191713 breaks Firefox build
  2012-09-25 16:05 [Bug lto/54709] New: [4.8 Regression] r191713 breaks Firefox build markus at trippelsdorf dot de
  2012-09-26  9:27 ` [Bug lto/54709] " rguenth at gcc dot gnu.org
@ 2012-09-26 10:11 ` rguenth at gcc dot gnu.org
  2012-09-26 11:56 ` rguenth at gcc dot gnu.org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-09-26 10:11 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-26 10:10:42 UTC ---
Turns out the location changes broke streamer_handle_as_builtin_p (which
uses broken predicates).  Testing

Index: tree-streamer.h
===================================================================
--- tree-streamer.h     (revision 191756)
+++ tree-streamer.h     (working copy)
@@ -57,10 +57,7 @@ struct streamer_tree_cache_d
 static inline bool
 streamer_handle_as_builtin_p (tree expr)
 {
-  return (TREE_CODE (expr) == FUNCTION_DECL
-         && DECL_IS_BUILTIN (expr)
-         && (DECL_BUILT_IN_CLASS (expr) == BUILT_IN_NORMAL
-             || DECL_BUILT_IN_CLASS (expr) == BUILT_IN_MD));
+  return (TREE_CODE (expr) == FUNCTION_DECL && DECL_BUILT_IN (expr));
 }

 /* In tree-streamer-in.c.  */

and reverting the original patch.


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

* [Bug lto/54709] [4.8 Regression] r191713 breaks Firefox build
  2012-09-25 16:05 [Bug lto/54709] New: [4.8 Regression] r191713 breaks Firefox build markus at trippelsdorf dot de
  2012-09-26  9:27 ` [Bug lto/54709] " rguenth at gcc dot gnu.org
  2012-09-26 10:11 ` rguenth at gcc dot gnu.org
@ 2012-09-26 11:56 ` rguenth at gcc dot gnu.org
  2012-09-26 12:49 ` markus at trippelsdorf dot de
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-09-26 11:56 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-26 11:56:37 UTC ---
Seems that doesn't work (yeah, the builtin defs issue ... bah).  The following
might (w/o reverting the previous change):

Index: gcc/tree.h
===================================================================
--- gcc/tree.h  (revision 191756)
+++ gcc/tree.h  (working copy)
@@ -2617,7 +2617,7 @@ struct function;
 #define DECL_SOURCE_LINE(NODE) LOCATION_LINE (DECL_SOURCE_LOCATION (NODE))
 #define DECL_SOURCE_COLUMN(NODE) LOCATION_COLUMN (DECL_SOURCE_LOCATION (NODE))
 #define DECL_IS_BUILTIN(DECL) \
-  (DECL_SOURCE_LOCATION (DECL) <= BUILTINS_LOCATION)
+  (LOCATION_LOCUS (DECL_SOURCE_LOCATION (DECL)) <= BUILTINS_LOCATION)

 /*  For FIELD_DECLs, this is the RECORD_TYPE, UNION_TYPE, or
     QUAL_UNION_TYPE node that the field is a member of.  For VAR_DECL,


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

* [Bug lto/54709] [4.8 Regression] r191713 breaks Firefox build
  2012-09-25 16:05 [Bug lto/54709] New: [4.8 Regression] r191713 breaks Firefox build markus at trippelsdorf dot de
                   ` (2 preceding siblings ...)
  2012-09-26 11:56 ` rguenth at gcc dot gnu.org
@ 2012-09-26 12:49 ` markus at trippelsdorf dot de
  2012-09-26 13:11 ` rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: markus at trippelsdorf dot de @ 2012-09-26 12:49 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-09-26 12:48:49 UTC ---
(In reply to comment #3)
> Seems that doesn't work (yeah, the builtin defs issue ... bah).  The following
> might (w/o reverting the previous change):
> 
> Index: gcc/tree.h
> ===================================================================
> --- gcc/tree.h  (revision 191756)
> +++ gcc/tree.h  (working copy)
> @@ -2617,7 +2617,7 @@ struct function;
>  #define DECL_SOURCE_LINE(NODE) LOCATION_LINE (DECL_SOURCE_LOCATION (NODE))
>  #define DECL_SOURCE_COLUMN(NODE) LOCATION_COLUMN (DECL_SOURCE_LOCATION (NODE))
>  #define DECL_IS_BUILTIN(DECL) \
> -  (DECL_SOURCE_LOCATION (DECL) <= BUILTINS_LOCATION)
> +  (LOCATION_LOCUS (DECL_SOURCE_LOCATION (DECL)) <= BUILTINS_LOCATION)
> 
>  /*  For FIELD_DECLs, this is the RECORD_TYPE, UNION_TYPE, or
>      QUAL_UNION_TYPE node that the field is a member of.  For VAR_DECL,

Hmm, I've tested this one and it didn't fix this bug.


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

* [Bug lto/54709] [4.8 Regression] r191713 breaks Firefox build
  2012-09-25 16:05 [Bug lto/54709] New: [4.8 Regression] r191713 breaks Firefox build markus at trippelsdorf dot de
                   ` (3 preceding siblings ...)
  2012-09-26 12:49 ` markus at trippelsdorf dot de
@ 2012-09-26 13:11 ` rguenth at gcc dot gnu.org
  2012-09-26 13:29 ` markus at trippelsdorf dot de
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-09-26 13:11 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-26 13:11:14 UTC ---
Ok, this bug won't be fixed and I'm not sure the reduced testcase handling is
a bug.  With

void * memcpy (void *, void *, long);
bar ()
{
    memcpy (0, 1, 1);
}

and -fvisibility=hidden the C frontend marks the memcpy builtin as having
hidden visibility (bug?).  Then at LTRANS time we fail to "merge" it
with the implicit declaration of memcpy from the other TU (which didn't
get hidden visibility - bug?), so this unmerged declaration gets output
via default_elf_asm_output_external which emits (bug?)

.hidden memcpy

and the link fails.

In the TU that does not declare memcpy the memcpy is expanded inline.

With

void foo (void *p, void *q, unsigned s)
{
  __builtin_memcpy (p, q, s);
}

---

void * memcpy (void *, void *, long);
void bar (void *p, void *q, unsigned s)
{
  memcpy (p, q, s);
}

both calls remain (undefined, .hidden is still emitted), no warnings.


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

* [Bug lto/54709] [4.8 Regression] r191713 breaks Firefox build
  2012-09-25 16:05 [Bug lto/54709] New: [4.8 Regression] r191713 breaks Firefox build markus at trippelsdorf dot de
                   ` (4 preceding siblings ...)
  2012-09-26 13:11 ` rguenth at gcc dot gnu.org
@ 2012-09-26 13:29 ` markus at trippelsdorf dot de
  2012-09-26 13:33 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: markus at trippelsdorf dot de @ 2012-09-26 13:29 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #6 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-09-26 13:28:48 UTC ---
(In reply to comment #5)
> Ok, this bug won't be fixed and I'm not sure the reduced testcase handling is
> a bug. 

It also only happens with -O0. Now -flto and -O0 are not commonly used
together,
so I think this bug isn't this important.


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

* [Bug lto/54709] [4.8 Regression] r191713 breaks Firefox build
  2012-09-25 16:05 [Bug lto/54709] New: [4.8 Regression] r191713 breaks Firefox build markus at trippelsdorf dot de
                   ` (5 preceding siblings ...)
  2012-09-26 13:29 ` markus at trippelsdorf dot de
@ 2012-09-26 13:33 ` rguenth at gcc dot gnu.org
  2012-09-26 13:39 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-09-26 13:33 UTC (permalink / raw)
  To: gcc-bugs


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

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

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

--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-26 13:33:07 UTC ---
For non-LTO binds_local_p says no to memcpy, for LTO it says yes.

  else if (TREE_CODE (exp) == FUNCTION_DECL && TREE_PUBLIC (exp))
    {
      struct cgraph_node *node = cgraph_get_node (exp);
      if (node
          && resolution_local_p (node->symbol.resolution))
        resolved_locally = true;

makes the difference because we have a resolution recorded (resoved_ir) and
that makes us skip


  /* Variables defined outside this object might not be local.  */
  else if (DECL_EXTERNAL (exp) && !resolved_locally)
    local_p = false;

and fall into

  /* If defined in this object and visibility is not default, must be
     local.  */
  else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT)
    local_p = true;

which says "defined in this object" but doesn't check that (well,
the resolution is wrong).

The resolutions from the linker are just

2
t1.o 1
165 beb4fef7e77e8790 PREVAILING_DEF_IRONLY foo
t2.o 1
165 6eae315f149cc09b PREVAILING_DEF_IRONLY bar

but lto_symtab_resolve_symbols assigns LDPR_RESOLVED_IR :(


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

* [Bug lto/54709] [4.8 Regression] r191713 breaks Firefox build
  2012-09-25 16:05 [Bug lto/54709] New: [4.8 Regression] r191713 breaks Firefox build markus at trippelsdorf dot de
                   ` (6 preceding siblings ...)
  2012-09-26 13:33 ` rguenth at gcc dot gnu.org
@ 2012-09-26 13:39 ` jakub at gcc dot gnu.org
  2012-09-26 13:47 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-09-26 13:39 UTC (permalink / raw)
  To: gcc-bugs


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

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

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

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-09-26 13:38:51 UTC ---
If you have a memcpy prototype and -fvisibility-hidden, without any pragmas
around the prototype tweaking the visibility, then this is IMHO a user bug, as
he promises then that memcpy is defined in the current shared library.
To use -fvisibility-hidden with standard headers, one needs to surround them
with pragmas.


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

* [Bug lto/54709] [4.8 Regression] r191713 breaks Firefox build
  2012-09-25 16:05 [Bug lto/54709] New: [4.8 Regression] r191713 breaks Firefox build markus at trippelsdorf dot de
                   ` (7 preceding siblings ...)
  2012-09-26 13:39 ` jakub at gcc dot gnu.org
@ 2012-09-26 13:47 ` rguenth at gcc dot gnu.org
  2012-09-26 14:15 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-09-26 13:47 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #9 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-26 13:47:02 UTC ---
Index: gcc/lto-symtab.c
===================================================================
--- gcc/lto-symtab.c    (revision 191756)
+++ gcc/lto-symtab.c    (working copy)
@@ -326,11 +326,7 @@ lto_symtab_resolve_symbols (symtab_node
   for (e = first; e; e = e->symbol.next_sharing_asm_name)
     {
       if (!lto_symtab_resolve_can_prevail_p (e))
-       {
-         e->symbol.resolution = LDPR_RESOLVED_IR;
-          set_resolution_guessed (e, true);
-         continue;
-       }
+       continue;

       /* Set a default resolution - the final prevailing one will get
          adjusted later.  */
@@ -387,9 +383,25 @@ lto_symtab_resolve_symbols (symtab_node
     }

   if (!prevailing)
-    return;
+    {
+      /* There was no prevailing definition - adjust the symbol resolutions
+         according to that.  */
+      for (e = first; e; e = e->symbol.next_sharing_asm_name)
+       e->symbol.resolution = LDPR_UNDEF;
+      return;
+    }

 found:
+  /* We found a prevailing definition - adjust the pre-empted symbols
+     resolutions.  */
+  for (e = first; e; e = e->symbol.next_sharing_asm_name)
+    {
+      if (!lto_symtab_resolve_can_prevail_p (e))
+       {
+         e->symbol.resolution = LDPR_RESOLVED_IR;
+         set_resolution_guessed (e, true);
+       }
+    }
   /* If current lto files represent the whole program,
     it is correct to use LDPR_PREVALING_DEF_IRONLY.
     If current lto files are part of whole program, internal

fixes the testcase for me.


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

* [Bug lto/54709] [4.8 Regression] r191713 breaks Firefox build
  2012-09-25 16:05 [Bug lto/54709] New: [4.8 Regression] r191713 breaks Firefox build markus at trippelsdorf dot de
                   ` (8 preceding siblings ...)
  2012-09-26 13:47 ` rguenth at gcc dot gnu.org
@ 2012-09-26 14:15 ` rguenth at gcc dot gnu.org
  2012-09-26 14:25 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-09-26 14:15 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #10 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-26 14:14:52 UTC ---
Created attachment 28284
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28284
patch

I am testing this.


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

* [Bug lto/54709] [4.8 Regression] r191713 breaks Firefox build
  2012-09-25 16:05 [Bug lto/54709] New: [4.8 Regression] r191713 breaks Firefox build markus at trippelsdorf dot de
                   ` (9 preceding siblings ...)
  2012-09-26 14:15 ` rguenth at gcc dot gnu.org
@ 2012-09-26 14:25 ` rguenth at gcc dot gnu.org
  2012-09-27  9:11 ` rguenth at gcc dot gnu.org
  2012-09-27  9:12 ` rguenth at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-09-26 14:25 UTC (permalink / raw)
  To: gcc-bugs


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

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

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

--- Comment #11 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-26 14:25:08 UTC ---
Created attachment 28285
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28285
new patch

Even better.


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

* [Bug lto/54709] [4.8 Regression] r191713 breaks Firefox build
  2012-09-25 16:05 [Bug lto/54709] New: [4.8 Regression] r191713 breaks Firefox build markus at trippelsdorf dot de
                   ` (10 preceding siblings ...)
  2012-09-26 14:25 ` rguenth at gcc dot gnu.org
@ 2012-09-27  9:11 ` rguenth at gcc dot gnu.org
  2012-09-27  9:12 ` rguenth at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-09-27  9:11 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #12 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-27 09:11:23 UTC ---
Author: rguenth
Date: Thu Sep 27 09:11:18 2012
New Revision: 191798

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191798
Log:
2012-09-27  Richard Guenther  <rguenther@suse.de>

    PR lto/54709
    * lto-symtab.c (resolution_guessed_p): Remove.
    (set_resolution_guessed): Likewise.
    (lto_symtab_register_decl): Remove assert.
    (lto_symtab_resolve_symbols): Do not alter symbol resolutions
    and return the prevailing symbol, checking for multiple prevailing
    symbols here.
    (lto_symtab_merge_decls_1): Use the result from
    lto_symtab_resolve_symbols.  Do not alter symbol resolutions.

    * gcc.dg/lto/pr54709_0.c: New testcase.
    * gcc.dg/lto/pr54709_1.c: Likewise.

Added:
    trunk/gcc/testsuite/gcc.dg/lto/pr54709_0.c
    trunk/gcc/testsuite/gcc.dg/lto/pr54709_1.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/lto-symtab.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug lto/54709] [4.8 Regression] r191713 breaks Firefox build
  2012-09-25 16:05 [Bug lto/54709] New: [4.8 Regression] r191713 breaks Firefox build markus at trippelsdorf dot de
                   ` (11 preceding siblings ...)
  2012-09-27  9:11 ` rguenth at gcc dot gnu.org
@ 2012-09-27  9:12 ` rguenth at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-09-27  9:12 UTC (permalink / raw)
  To: gcc-bugs


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

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

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

--- Comment #13 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-27 09:11:48 UTC ---
Fixed.


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

end of thread, other threads:[~2012-09-27  9:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-25 16:05 [Bug lto/54709] New: [4.8 Regression] r191713 breaks Firefox build markus at trippelsdorf dot de
2012-09-26  9:27 ` [Bug lto/54709] " rguenth at gcc dot gnu.org
2012-09-26 10:11 ` rguenth at gcc dot gnu.org
2012-09-26 11:56 ` rguenth at gcc dot gnu.org
2012-09-26 12:49 ` markus at trippelsdorf dot de
2012-09-26 13:11 ` rguenth at gcc dot gnu.org
2012-09-26 13:29 ` markus at trippelsdorf dot de
2012-09-26 13:33 ` rguenth at gcc dot gnu.org
2012-09-26 13:39 ` jakub at gcc dot gnu.org
2012-09-26 13:47 ` rguenth at gcc dot gnu.org
2012-09-26 14:15 ` rguenth at gcc dot gnu.org
2012-09-26 14:25 ` rguenth at gcc dot gnu.org
2012-09-27  9:11 ` rguenth at gcc dot gnu.org
2012-09-27  9:12 ` 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).