public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/44812]  New: m32 lto produces non-relocatable subtraction expression errors
@ 2010-07-04 15:17 howarth at nitro dot med dot uc dot edu
  2010-07-04 15:23 ` [Bug lto/44812] " howarth at nitro dot med dot uc dot edu
                   ` (32 more replies)
  0 siblings, 33 replies; 36+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-07-04 15:17 UTC (permalink / raw)
  To: gcc-bugs

On x86_64-apple-darwin* and i*86-apple-darwin*, a number of lto failures remain
at -m32 which are of the form...

/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/gcc/xgcc
-B/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/gcc/ c_lto_20081111_0.o
c_lto_20081111_1.o -O0 -fwhopr -m32 -o gcc-dg-lto-20081111-01
/var/folders/1C/1CdoNxmNFHyOIjNBLNuJh++++TM/-Tmp-//ccogqVKS.s:15:non-relocatable
subtraction expression, "_mumble" minus "L00000000001$pb"
/var/folders/1C/1CdoNxmNFHyOIjNBLNuJh++++TM/-Tmp-//ccogqVKS.s:15:symbol:
"_mumble" can't be undefined in a subtraction expression
/var/folders/1C/1CdoNxmNFHyOIjNBLNuJh++++TM/-Tmp-//ccogqVKS.s:13:non-relocatable
subtraction expression, "_mumble" minus "L00000000001$pb"
/var/folders/1C/1CdoNxmNFHyOIjNBLNuJh++++TM/-Tmp-//ccogqVKS.s:13:symbol:
"_mumble" can't be undefined in a subtraction expression
/var/folders/1C/1CdoNxmNFHyOIjNBLNuJh++++TM/-Tmp-//ccogqVKS.s:10:non-relocatable
subtraction expression, "_mumble" minus "L00000000001$pb"
/var/folders/1C/1CdoNxmNFHyOIjNBLNuJh++++TM/-Tmp-//ccogqVKS.s:10:symbol:
"_mumble" can't be undefined in a subtraction expression
lto-wrapper: /sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/gcc/xgcc
returned 1 exit status


-- 
           Summary: m32 lto produces non-relocatable subtraction expression
                    errors
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: howarth at nitro dot med dot uc dot edu
 GCC build triplet: *86*-apple-darwin10
  GCC host triplet: *86*-apple-darwin10
GCC target triplet: *86*-apple-darwin10


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
@ 2010-07-04 15:23 ` howarth at nitro dot med dot uc dot edu
  2010-07-04 15:24 ` howarth at nitro dot med dot uc dot edu
                   ` (31 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-07-04 15:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from howarth at nitro dot med dot uc dot edu  2010-07-04 15:23 -------
Created an attachment (id=21082)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21082&action=view)
assembly file 20081111_0.s

/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/gcc/xgcc
-B/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/gcc/ -O0 -fwhopr
--save-temps -c -m32 -o c_lto_20081111_0.o
/sw/src/fink.build/gcc46-4.6.0-1000/gcc-4.6-20100703/gcc/testsuite/gcc.dg/lto/20081111_0.c


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
  2010-07-04 15:23 ` [Bug lto/44812] " howarth at nitro dot med dot uc dot edu
@ 2010-07-04 15:24 ` howarth at nitro dot med dot uc dot edu
  2010-07-04 15:25 ` howarth at nitro dot med dot uc dot edu
                   ` (30 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-07-04 15:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from howarth at nitro dot med dot uc dot edu  2010-07-04 15:24 -------
Created an attachment (id=21084)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21084&action=view)
assembly file 20081111_1.s

/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/gcc/xgcc
-B/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/gcc/ -O0 -fwhopr -c -m32
--save-temps -o c_lto_20081111_1.o
/sw/src/fink.build/gcc46-4.6.0-1000/gcc-4.6-20100703/gcc/testsuite/gcc.dg/lto/20081111_1.c


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
  2010-07-04 15:23 ` [Bug lto/44812] " howarth at nitro dot med dot uc dot edu
  2010-07-04 15:24 ` howarth at nitro dot med dot uc dot edu
@ 2010-07-04 15:25 ` howarth at nitro dot med dot uc dot edu
  2010-07-15 13:20 ` howarth at nitro dot med dot uc dot edu
                   ` (29 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-07-04 15:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from howarth at nitro dot med dot uc dot edu  2010-07-04 15:25 -------
Created an attachment (id=21085)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21085&action=view)
assembly file gcc-dg-lto-20081111-01.ltrans0.s

/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/gcc/xgcc
-B/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/gcc/ c_lto_20081111_0.o
c_lto_20081111_1.o -O0 -fwhopr --save-temps -m32 -o gcc-dg-lto-20081111-01


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (2 preceding siblings ...)
  2010-07-04 15:25 ` howarth at nitro dot med dot uc dot edu
@ 2010-07-15 13:20 ` howarth at nitro dot med dot uc dot edu
  2010-08-24 13:01 ` hubicka at gcc dot gnu dot org
                   ` (28 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-07-15 13:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from howarth at nitro dot med dot uc dot edu  2010-07-15 13:19 -------
At -m32 on x86_64-apple-darwin10, the test cases which fail due to symbols
being optimized away include...

FAIL: g++.dg/lto/20081118-1 cp_lto_20081118-1_0.o-cp_lto_20081118-1_1.o link,
-O2 -fwhopr
FAIL: g++.dg/lto/20081119-1 cp_lto_20081119-1_0.o-cp_lto_20081119-1_1.o link,
-fPIC -fwhopr -r -nostdlib
FAIL: g++.dg/lto/20081125 cp_lto_20081125_0.o-cp_lto_20081125_1.o link, -fwhopr
FAIL: g++.dg/lto/20081209 cp_lto_20081209_0.o-cp_lto_20081209_1.o link, -O0
-fwhopr
FAIL: g++.dg/lto/20081209 cp_lto_20081209_0.o-cp_lto_20081209_1.o link, -O2
-fwhopr
FAIL: g++.dg/lto/20081211-1 cp_lto_20081211-1_0.o-cp_lto_20081211-1_1.o link,
-O0 -fwhopr
FAIL: g++.dg/lto/20081211-1 cp_lto_20081211-1_0.o-cp_lto_20081211-1_1.o link,
-O2 -fwhopr
FAIL: g++.dg/lto/20090302 cp_lto_20090302_0.o-cp_lto_20090302_1.o link, -fPIC
-fwhopr -r -nostdlib
FAIL: g++.dg/lto/20090311-1 cp_lto_20090311-1_0.o-cp_lto_20090311-1_1.o link,
-O0 -fwhopr
FAIL: g++.dg/lto/20090311-1 cp_lto_20090311-1_0.o-cp_lto_20090311-1_1.o link,
-O2 -fwhopr
FAIL: g++.dg/lto/20090311 cp_lto_20090311_0.o-cp_lto_20090311_1.o link, -O0
-fwhopr
FAIL: g++.dg/lto/20090312 cp_lto_20090312_0.o-cp_lto_20090312_1.o link, -O0
-fwhopr
FAIL: g++.dg/lto/20090312 cp_lto_20090312_0.o-cp_lto_20090312_1.o link, -O2
-fwhopr
FAIL: g++.dg/lto/20090315 cp_lto_20090315_0.o-cp_lto_20090315_1.o link, -O0
-fwhopr
FAIL: g++.dg/lto/20090315 cp_lto_20090315_0.o-cp_lto_20090315_1.o link, -O2
-fwhopr
FAIL: g++.dg/lto/20091210-1 cp_lto_20091210-1_0.o-cp_lto_20091210-1_1.o link,
-O0 -fwhopr
FAIL: g++.dg/lto/20091210-1 cp_lto_20091210-1_0.o-cp_lto_20091210-1_1.o link,
-O2 -fwhopr
FAIL: g++.dg/torture/pr43879-1_1.C  -O2 -fwhopr  (test for excess errors)
FAIL: gcc.dg/lto/20081111 c_lto_20081111_0.o-c_lto_20081111_1.o link, -O0
-fwhopr
FAIL: gcc.dg/lto/20081111 c_lto_20081111_0.o-c_lto_20081111_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20081112 c_lto_20081112_0.o-c_lto_20081112_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20090213 c_lto_20090213_0.o-c_lto_20090213_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20090218 c_lto_20090218_0.o-c_lto_20090218_3.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20090717 c_lto_20090717_0.o-c_lto_20090717_1.o link, -O0
-fwhopr
FAIL: gcc.dg/lto/20090717 c_lto_20090717_0.o-c_lto_20090717_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20091005-1 c_lto_20091005-1_0.o-c_lto_20091005-1_1.o link, -O0
-fwhopr
FAIL: gcc.dg/lto/20100227-1 c_lto_20100227-1_0.o-c_lto_20100227-1_1.o link, -O0
-fwhopr
FAIL: gcc.dg/lto/20100227-1 c_lto_20100227-1_0.o-c_lto_20100227-1_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/ipacp c_lto_ipacp_0.o-c_lto_ipacp_1.o link,  -O1 -fwhopr
-fipa-cp -fipa-cp-clone
FAIL: gcc.dg/lto/ipareference2 c_lto_ipareference2_0.o-c_lto_ipareference2_1.o
link,  -O1 -fwhopr -fwhole-program
FAIL: gcc.dg/lto/materialize-1 c_lto_materialize-1_0.o-c_lto_materialize-1_1.o
link,  -O3 -fwhopr
FAIL: gcc.dg/torture/pr43879_1.c  -O2 -fwhopr  (test for excess errors)

...which represents almost the entirety of the lto related failures at -m32 on
darwin.


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (3 preceding siblings ...)
  2010-07-15 13:20 ` howarth at nitro dot med dot uc dot edu
@ 2010-08-24 13:01 ` hubicka at gcc dot gnu dot org
  2010-08-24 13:17 ` dominiq at lps dot ens dot fr
                   ` (27 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: hubicka at gcc dot gnu dot org @ 2010-08-24 13:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from hubicka at gcc dot gnu dot org  2010-08-24 13:01 -------
Hmm, the problem seems to be that partitioning puts mumble into one partition,
while in first partition it uses local (IP) relative way to access it:
movl    _mumble-L00000000001$pb(%ebx), %eax
and assembler refuse it.  What is proper way to access hidden symbol from other
.s file?


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (4 preceding siblings ...)
  2010-08-24 13:01 ` hubicka at gcc dot gnu dot org
@ 2010-08-24 13:17 ` dominiq at lps dot ens dot fr
  2010-08-24 13:44 ` hubicka at gcc dot gnu dot org
                   ` (26 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: dominiq at lps dot ens dot fr @ 2010-08-24 13:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from dominiq at lps dot ens dot fr  2010-08-24 13:17 -------
The same errors appear on powerpc-apple-darwin9 with both -m32 and -m64 (see
http://gcc.gnu.org/ml/gcc-testresults/2010-08/msg00777.html ).


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (6 preceding siblings ...)
  2010-08-24 13:44 ` hubicka at gcc dot gnu dot org
@ 2010-08-24 13:44 ` howarth at nitro dot med dot uc dot edu
  2010-08-24 13:47 ` iains at gcc dot gnu dot org
                   ` (24 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-08-24 13:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from howarth at nitro dot med dot uc dot edu  2010-08-24 13:44 -------
(In reply to comment #5)
> Hmm, the problem seems to be that partitioning puts mumble into one partition,
> while in first partition it uses local (IP) relative way to access it:
> movl    _mumble-L00000000001$pb(%ebx), %eax
> and assembler refuse it.  What is proper way to access hidden symbol from other
> .s file?
> 

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729#c33
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729#c37
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729#c42


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (5 preceding siblings ...)
  2010-08-24 13:17 ` dominiq at lps dot ens dot fr
@ 2010-08-24 13:44 ` hubicka at gcc dot gnu dot org
  2010-08-24 13:44 ` howarth at nitro dot med dot uc dot edu
                   ` (25 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: hubicka at gcc dot gnu dot org @ 2010-08-24 13:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from hubicka at gcc dot gnu dot org  2010-08-24 13:44 -------
the following testcase:
__attribute__((visibility ("hidden"))) extern int mumble;
extern void abort (void);
extern void exit (int);

int
main ()
{
  if (++mumble != 42)
    abort ();
  exit (0);
}

should compile to pretty much the same as the partition. We get:
        call    ___i686.get_pc_thunk.bx
L00000000001$pb:
        subl    $24, %esp
LCFI1:
        movl    L_mumble$non_lazy_ptr-L00000000001$pb(%ebx), %edx
        movl    (%edx), %eax
        addl    $1, %eax
        cmpl    $42, %eax
        movl    %eax, (%edx)
        je      L2
        call    _abort

and later
L_mumble$non_lazy_ptr:
        .long   _mumble

while in the partitoin we get:
CFI1:  
        movl    _mumble-L00000000001$pb(%ebx), %eax
        addl    $1, %eax
        cmpl    $42, %eax
        movl    %eax, _mumble-L00000000001$pb(%ebx)
        je      L2
        call    _abort
L2:
        movl    $0, (%esp)
        call    _exit
LFE0:   

and no later mention of it...


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (7 preceding siblings ...)
  2010-08-24 13:44 ` howarth at nitro dot med dot uc dot edu
@ 2010-08-24 13:47 ` iains at gcc dot gnu dot org
  2010-08-24 14:11 ` iains at gcc dot gnu dot org
                   ` (23 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: iains at gcc dot gnu dot org @ 2010-08-24 13:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from iains at gcc dot gnu dot org  2010-08-24 13:47 -------
(In reply to comment #5)
> Hmm, the problem seems to be that partitioning puts mumble into one partition,
> while in first partition it uses local (IP) relative way to access it:
> movl    _mumble-L00000000001$pb(%ebx), %eax
> and assembler refuse it.  What is proper way to access hidden symbol from other
> .s file?

Take a look at the output of compilation without lto .. 
.. the symbol is indirected - since it cannot be guaranteed to be within reach
otherwise;

so (by convention) 
_mumble-L00000000001$pb   => L__mumble$non_lazy_ptr-L00000000001$pb

......

        .non_lazy_symbol_pointer
L_mumble$non_lazy_ptr:
        .indirect_symbol _mumble
        .long   0


-- 

iains at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |iains at gcc dot gnu dot org


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (8 preceding siblings ...)
  2010-08-24 13:47 ` iains at gcc dot gnu dot org
@ 2010-08-24 14:11 ` iains at gcc dot gnu dot org
  2010-08-24 14:37 ` iains at gcc dot gnu dot org
                   ` (22 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: iains at gcc dot gnu dot org @ 2010-08-24 14:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from iains at gcc dot gnu dot org  2010-08-24 14:11 -------
(In reply to comment #9)
> (In reply to comment #5)
> > Hmm, the problem seems to be that partitioning puts mumble into one partition,
> > while in first partition it uses local (IP) relative way to access it:
> > movl    _mumble-L00000000001$pb(%ebx), %eax
> > and assembler refuse it.  What is proper way to access hidden symbol from other
> > .s file?
> 
> Take a look at the output of compilation without lto .. 
> .. the symbol is indirected - since it cannot be guaranteed to be within reach
> otherwise;
>

which you already posted,
I don't think the hidden attribute is relevant, looking at other fails.

local symbols need to be registered with machopic_define_symbol() 
(see config/darwin.h ASM_DECLARE_OBJECT_NAME).

they are processed via machopic_finish() called from darwin_file_end ()
[config/darwin.c] 
which , I assume is still called in the lto case?


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (9 preceding siblings ...)
  2010-08-24 14:11 ` iains at gcc dot gnu dot org
@ 2010-08-24 14:37 ` iains at gcc dot gnu dot org
  2010-08-24 15:04   ` Jan Hubicka
  2010-08-24 15:05 ` hubicka at ucw dot cz
                   ` (21 subsequent siblings)
  32 siblings, 1 reply; 36+ messages in thread
From: iains at gcc dot gnu dot org @ 2010-08-24 14:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from iains at gcc dot gnu dot org  2010-08-24 14:37 -------
essentially to turn the last comment around:

IIUC, if whopr changes a symbol from "external" to "local"  then it needs to
register that symbol with machopic_define_symbol () -- and ensure that  (*
targetm.encode_section_info) (DECL, DECL_RTL (DECL), false); gets called too.. 


-- 


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


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

* Re: [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-08-24 14:37 ` iains at gcc dot gnu dot org
@ 2010-08-24 15:04   ` Jan Hubicka
  0 siblings, 0 replies; 36+ messages in thread
From: Jan Hubicka @ 2010-08-24 15:04 UTC (permalink / raw)
  To: iains at gcc dot gnu dot org; +Cc: gcc-bugs

Hmm, actually the symbol is not changed, since it is externally visible symbol.
I guess the problem would be that the symbol is used by 2 units, so both of
them gets the declaration, but both of them gets the declaration with
initializer (not extern).  To avoid duplicate definitions, varpool.c is testing
in_other_partition and prevents calling assemble_variable on them. This works
just fine on ELF since extern vars don't need to be announced.  Here we
apparently need to get it assembled, but it is not getting via
assemble_external.

Rebuilding the decl to DECL_EXTERN is probably possible, but somewhat hackish.

Honza


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (10 preceding siblings ...)
  2010-08-24 14:37 ` iains at gcc dot gnu dot org
@ 2010-08-24 15:05 ` hubicka at ucw dot cz
  2010-08-24 15:17 ` iains at gcc dot gnu dot org
                   ` (20 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: hubicka at ucw dot cz @ 2010-08-24 15:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from hubicka at ucw dot cz  2010-08-24 15:04 -------
Subject: Re:  m32 lto produces non-relocatable subtraction
        expression errors

Hmm, actually the symbol is not changed, since it is externally visible symbol.
I guess the problem would be that the symbol is used by 2 units, so both of
them gets the declaration, but both of them gets the declaration with
initializer (not extern).  To avoid duplicate definitions, varpool.c is testing
in_other_partition and prevents calling assemble_variable on them. This works
just fine on ELF since extern vars don't need to be announced.  Here we
apparently need to get it assembled, but it is not getting via
assemble_external.

Rebuilding the decl to DECL_EXTERN is probably possible, but somewhat hackish.

Honza


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (11 preceding siblings ...)
  2010-08-24 15:05 ` hubicka at ucw dot cz
@ 2010-08-24 15:17 ` iains at gcc dot gnu dot org
  2010-08-24 15:40 ` howarth at nitro dot med dot uc dot edu
                   ` (19 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: iains at gcc dot gnu dot org @ 2010-08-24 15:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from iains at gcc dot gnu dot org  2010-08-24 15:17 -------
(In reply to comment #12)
> Subject: Re:  m32 lto produces non-relocatable subtraction
>         expression errors
> 
> Hmm, actually the symbol is not changed, since it is externally visible symbol.

ah, OK.

> assemble_external ().

is a no-op on darwin (unless the symbol is weak).
since we don't declare ASM_OUTPUT_EXTERNAL.

There might be some trick with marking the symbols weak/weak_import but I know
nothing of the internals of lto to comment further.


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (12 preceding siblings ...)
  2010-08-24 15:17 ` iains at gcc dot gnu dot org
@ 2010-08-24 15:40 ` howarth at nitro dot med dot uc dot edu
  2010-08-26  1:40 ` howarth at nitro dot med dot uc dot edu
                   ` (18 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-08-24 15:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from howarth at nitro dot med dot uc dot edu  2010-08-24 15:40 -------
What about Mike's suggestions from Comment 33 of PR43729 ...

"If one bundles all the code into the wpa file, one can preserve
_good_ codegen, which is the other way to fix this."


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (13 preceding siblings ...)
  2010-08-24 15:40 ` howarth at nitro dot med dot uc dot edu
@ 2010-08-26  1:40 ` howarth at nitro dot med dot uc dot edu
  2010-08-26  1:55 ` howarth at nitro dot med dot uc dot edu
                   ` (17 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-08-26  1:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from howarth at nitro dot med dot uc dot edu  2010-08-26 01:40 -------
Created an attachment (id=21567)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21567&action=view)
patch to effectively mark symbol as weak_import


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (14 preceding siblings ...)
  2010-08-26  1:40 ` howarth at nitro dot med dot uc dot edu
@ 2010-08-26  1:55 ` howarth at nitro dot med dot uc dot edu
  2010-08-26 10:19 ` howarth at nitro dot med dot uc dot edu
                   ` (16 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-08-26  1:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from howarth at nitro dot med dot uc dot edu  2010-08-26 01:55 -------
Marking the symbols in_other_partitions as weak eliminates almost all of the
failures. I still get...

Running target unix/-m32
FAIL: gcc.dg/lto/20090213 c_lto_20090213_0.o-c_lto_20090213_1.o link, -O2
-fwhopr
UNRESOLVED: gcc.dg/lto/20090213 c_lto_20090213_0.o-c_lto_20090213_1.o execute
-O2 -fwhopr
FAIL: gcc.dg/lto/20090218 c_lto_20090218_0.o-c_lto_20090218_3.o link, -O2
-fwhopr
UNRESOLVED: gcc.dg/lto/20090218 c_lto_20090218_0.o-c_lto_20090218_3.o execute
-O2 -fwhopr

 which still have the "non-relocatable subtraction expression"..."can't be
undefined in a subtraction expression" errors. This might suggest the same
problem exists somewhere else in varpool.c.


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (15 preceding siblings ...)
  2010-08-26  1:55 ` howarth at nitro dot med dot uc dot edu
@ 2010-08-26 10:19 ` howarth at nitro dot med dot uc dot edu
  2010-08-26 16:01 ` howarth at nitro dot med dot uc dot edu
                   ` (15 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-08-26 10:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from howarth at nitro dot med dot uc dot edu  2010-08-26 10:18 -------
Testresults with proposed patch at
http://gcc.gnu.org/ml/gcc-testresults/2010-08/msg02586.html.


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (16 preceding siblings ...)
  2010-08-26 10:19 ` howarth at nitro dot med dot uc dot edu
@ 2010-08-26 16:01 ` howarth at nitro dot med dot uc dot edu
  2010-08-26 20:03 ` dominiq at lps dot ens dot fr
                   ` (14 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-08-26 16:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from howarth at nitro dot med dot uc dot edu  2010-08-26 16:01 -------
Jan's alternative patch...

Index: lto-cgraph.c
===================================================================
--- lto-cgraph.c        (revision 163494)
+++ lto-cgraph.c        (working copy)
@@ -1109,6 +1109,8 @@
   node->analyzed = node->finalized;
   node->used_from_other_partition = bp_unpack_value (&bp, 1);
   node->in_other_partition = bp_unpack_value (&bp, 1);
+  if (node->in_other_partition)
+    DECL_EXTERNAL (node->decl) = 1;
   aliases_p = bp_unpack_value (&bp, 1);
   if (node->finalized)
     varpool_mark_needed_node (node);

works only slightly worse than marking the symbols weak. This produces the
failures...

Running target unix/-m32
FAIL: gcc.dg/lto/20090213 c_lto_20090213_0.o-c_lto_20090213_1.o link, -O2
-fwhopr
UNRESOLVED: gcc.dg/lto/20090213 c_lto_20090213_0.o-c_lto_20090213_1.o execute
-O2 -fwhopr
FAIL: gcc.dg/lto/20090218 c_lto_20090218_0.o-c_lto_20090218_3.o link, -O2
-fwhopr
UNRESOLVED: gcc.dg/lto/20090218 c_lto_20090218_0.o-c_lto_20090218_3.o execute
-O2 -fwhopr
FAIL: gcc.dg/lto/ipareference2 c_lto_ipareference2_0.o-c_lto_ipareference2_1.o
execute  -O1 -fwhopr -fwhole-program

in the gcc testsuite. The last failure was suppressed in the previous case.


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (17 preceding siblings ...)
  2010-08-26 16:01 ` howarth at nitro dot med dot uc dot edu
@ 2010-08-26 20:03 ` dominiq at lps dot ens dot fr
  2010-08-27  0:09 ` dominiq at lps dot ens dot fr
                   ` (13 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: dominiq at lps dot ens dot fr @ 2010-08-26 20:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from dominiq at lps dot ens dot fr  2010-08-26 20:03 -------
With the patch in comment #18, with -m64 I see the following failure

FAIL: gcc.dg/lto/ipareference2 c_lto_ipareference2_0.o-c_lto_ipareference2_1.o
execute  -O1 -fwhopr -fwhole-program

which was only present with -m32 without the patch. Otherwise the patch fixes
many failures for the gcc and g++ test suites.


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (18 preceding siblings ...)
  2010-08-26 20:03 ` dominiq at lps dot ens dot fr
@ 2010-08-27  0:09 ` dominiq at lps dot ens dot fr
  2010-08-27  0:42 ` howarth at nitro dot med dot uc dot edu
                   ` (12 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: dominiq at lps dot ens dot fr @ 2010-08-27  0:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #20 from dominiq at lps dot ens dot fr  2010-08-27 00:09 -------
The patch in comment #18 works also on powerpc-apple-darwin9:

Running target unix/-m32
Using /sw/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /sw/share/dejagnu/config/unix.exp as generic interface file for target.
Using /opt/gcc/gcc-4.6-work/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running /opt/gcc/gcc-4.6-work/gcc/testsuite/gcc.dg/lto/lto.exp ...
FAIL: gcc.dg/lto/20090213 c_lto_20090213_0.o-c_lto_20090213_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20090218 c_lto_20090218_0.o-c_lto_20090218_3.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/ipareference2 c_lto_ipareference2_0.o-c_lto_ipareference2_1.o
execute  -O1 -fwhopr -fwhole-program

                === gcc Summary for unix/-m32 ===

# of expected passes            613
# of unexpected failures        3
# of unresolved testcases       2
# of unsupported tests          8
Running target unix/-m64
Using /sw/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /sw/share/dejagnu/config/unix.exp as generic interface file for target.
Using /opt/gcc/gcc-4.6-work/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running /opt/gcc/gcc-4.6-work/gcc/testsuite/gcc.dg/lto/lto.exp ...
FAIL: gcc.dg/lto/20090116 c_lto_20090116_0.o-c_lto_20090116_0.o link, -O1
-fwhopr -fPIC (internal compiler error)
FAIL: gcc.dg/lto/20090213 c_lto_20090213_0.o-c_lto_20090213_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20090218 c_lto_20090218_0.o-c_lto_20090218_3.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/ipareference2 c_lto_ipareference2_0.o-c_lto_ipareference2_1.o
execute  -O1 -fwhopr -fwhole-program

                === gcc Summary for unix/-m64 ===

# of expected passes            612
# of unexpected failures        4
# of unresolved testcases       3
# of unsupported tests          8

                === gcc Summary ===

# of expected passes            1225
# of unexpected failures        7
# of unresolved testcases       5
# of unsupported tests          16
/opt/gcc/darwin_buildw/gcc/xgcc  version 4.6.0 20100825 (experimental) [trunk
revision 163553p1] (GCC) 

with an extra ICE for gcc.dg/lto/20090116.


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (19 preceding siblings ...)
  2010-08-27  0:09 ` dominiq at lps dot ens dot fr
@ 2010-08-27  0:42 ` howarth at nitro dot med dot uc dot edu
  2010-08-27  0:44 ` howarth at nitro dot med dot uc dot edu
                   ` (11 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-08-27  0:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #21 from howarth at nitro dot med dot uc dot edu  2010-08-27 00:42 -------
Created an attachment (id=21575)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21575&action=view)
patch which completely eliminates -m32 darwin lto failures


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (20 preceding siblings ...)
  2010-08-27  0:42 ` howarth at nitro dot med dot uc dot edu
@ 2010-08-27  0:44 ` howarth at nitro dot med dot uc dot edu
  2010-08-27 10:31 ` dominiq at lps dot ens dot fr
                   ` (10 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-08-27  0:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #22 from howarth at nitro dot med dot uc dot edu  2010-08-27 00:44 -------
The m32_lto_fix2.diff patch expands the usage of DECL_WEAK into
gcc/lto-cgraph.c and is sufficient to eliminate all of the darwin-specific lto
failures at -m32. The only remaining ones are...


FAIL: g++.dg/lto/20100723-1 cp_lto_20100723-1_0.o-cp_lto_20100723-1_0.o link,
-fcompare-debug -flto (internal compiler error)
UNRESOLVED: g++.dg/lto/20100723-1 cp_lto_20100723-1_0.o-cp_lto_20100723-1_0.o
execute -fcompare-debug -flto
FAIL: g++.dg/lto/20100723-1 cp_lto_20100723-1_0.o-cp_lto_20100723-1_0.o link,
-fcompare-debug -fwhopr (internal compiler error)
UNRESOLVED: g++.dg/lto/20100723-1 cp_lto_20100723-1_0.o-cp_lto_20100723-1_0.o
execute -fcompare-debug -fwhopr


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (21 preceding siblings ...)
  2010-08-27  0:44 ` howarth at nitro dot med dot uc dot edu
@ 2010-08-27 10:31 ` dominiq at lps dot ens dot fr
  2010-08-27 12:10 ` howarth at nitro dot med dot uc dot edu
                   ` (9 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: dominiq at lps dot ens dot fr @ 2010-08-27 10:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #23 from dominiq at lps dot ens dot fr  2010-08-27 10:30 -------
With the patch in comment #21 I get for powerpc-apple-darwin9

Running target unix/-m32
Using /sw/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /sw/share/dejagnu/config/unix.exp as generic interface file for target.
Using /opt/gcc/gcc-4.6-work/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running /opt/gcc/gcc-4.6-work/gcc/testsuite/gcc.dg/lto/lto.exp ...

                === gcc Summary for unix/-m32 ===

# of expected passes            618
# of unsupported tests          8
Running target unix/-m64
Using /sw/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /sw/share/dejagnu/config/unix.exp as generic interface file for target.
Using /opt/gcc/gcc-4.6-work/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running /opt/gcc/gcc-4.6-work/gcc/testsuite/gcc.dg/lto/lto.exp ...
FAIL: gcc.dg/lto/20090116 c_lto_20090116_0.o-c_lto_20090116_0.o link, -O1
-fwhopr -fPIC (internal compiler error)

                === gcc Summary for unix/-m64 ===

# of expected passes            617
# of unexpected failures        1
# of unresolved testcases       1
# of unsupported tests          8

                === gcc Summary ===

# of expected passes            1235
# of unexpected failures        1
# of unresolved testcases       1
# of unsupported tests          16
/opt/gcc/darwin_buildw/gcc/xgcc  version 4.6.0 20100825 (experimental) [trunk
revision 163553p1b] (GCC) 

and

Running target unix/-m32
Using /sw/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /sw/share/dejagnu/config/unix.exp as generic interface file for target.
Using /opt/gcc/gcc-4.6-work/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running /opt/gcc/gcc-4.6-work/gcc/testsuite/g++.dg/lto/lto.exp ...
FAIL: g++.dg/lto/20081109 cp_lto_20081109_0.o-cp_lto_20081109_1.o execute -O2
-fwhopr
FAIL: g++.dg/lto/20100723-1 cp_lto_20100723-1_0.o-cp_lto_20100723-1_0.o link,
-fcompare-debug -flto (internal compiler error)
FAIL: g++.dg/lto/20100723-1 cp_lto_20100723-1_0.o-cp_lto_20100723-1_0.o link,
-fcompare-debug -fwhopr (internal compiler error)

                === g++ Summary for unix/-m32 ===

# of expected passes            459
# of unexpected failures        3
# of unresolved testcases       2
# of unsupported tests          1
Running target unix/-m64
Using /sw/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /sw/share/dejagnu/config/unix.exp as generic interface file for target.
Using /opt/gcc/gcc-4.6-work/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running /opt/gcc/gcc-4.6-work/gcc/testsuite/g++.dg/lto/lto.exp ...
FAIL: g++.dg/lto/20081109 cp_lto_20081109_0.o-cp_lto_20081109_1.o execute -O2
-fwhopr
FAIL: g++.dg/lto/20100723-1 cp_lto_20100723-1_0.o-cp_lto_20100723-1_0.o link,
-fcompare-debug -flto (internal compiler error)
FAIL: g++.dg/lto/20100723-1 cp_lto_20100723-1_0.o-cp_lto_20100723-1_0.o link,
-fcompare-debug -fwhopr (internal compiler error)

                === g++ Summary for unix/-m64 ===

# of expected passes            459
# of unexpected failures        3
# of unresolved testcases       2
# of unsupported tests          1

                === g++ Summary ===

# of expected passes            918
# of unexpected failures        6
# of unresolved testcases       4
# of unsupported tests          2
/opt/gcc/darwin_buildw/gcc/testsuite/g++/../../g++  version 4.6.0 20100825
(experimental) [trunk revision 163553p1b] (GCC) 


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (22 preceding siblings ...)
  2010-08-27 10:31 ` dominiq at lps dot ens dot fr
@ 2010-08-27 12:10 ` howarth at nitro dot med dot uc dot edu
  2010-08-27 13:54 ` howarth at nitro dot med dot uc dot edu
                   ` (8 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-08-27 12:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #24 from howarth at nitro dot med dot uc dot edu  2010-08-27 12:10 -------
Testsuite results for m32_to_fix2.diff at
http://gcc.gnu.org/ml/gcc-testresults/2010-08/msg02690.html.
This approach completely fixes the darwin-specific lto failures on
x86_64-apple-darwin10.


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (23 preceding siblings ...)
  2010-08-27 12:10 ` howarth at nitro dot med dot uc dot edu
@ 2010-08-27 13:54 ` howarth at nitro dot med dot uc dot edu
  2010-08-27 13:59 ` howarth at nitro dot med dot uc dot edu
                   ` (7 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-08-27 13:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #25 from howarth at nitro dot med dot uc dot edu  2010-08-27 13:54 -------
Created an attachment (id=21577)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21577&action=view)
m32 darwin lto fix using external


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (24 preceding siblings ...)
  2010-08-27 13:54 ` howarth at nitro dot med dot uc dot edu
@ 2010-08-27 13:59 ` howarth at nitro dot med dot uc dot edu
  2010-08-27 14:14 ` howarth at nitro dot med dot uc dot edu
                   ` (6 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-08-27 13:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #26 from howarth at nitro dot med dot uc dot edu  2010-08-27 13:59 -------
(In reply to comment #25)
> Created an attachment (id=21577)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21577&action=view) [edit]
> m32 darwin lto fix using external
> 

This version almost works. However I get the following c++ lto failures...

FAIL: g++.dg/lto/20081022 cp_lto_20081022_0.o-cp_lto_20081022_1.o link, -O0
-fwhopr
UNRESOLVED: g++.dg/lto/20081022 cp_lto_20081022_0.o-cp_lto_20081022_1.o execute
-O0 -fwhopr
FAIL: g++.dg/lto/20081125 cp_lto_20081125_0.o-cp_lto_20081125_1.o link, -fwhopr
UNRESOLVED: g++.dg/lto/20081125 cp_lto_20081125_0.o-cp_lto_20081125_1.o execute
-fwhopr
FAIL: g++.dg/lto/20081203 cp_lto_20081203_0.o-cp_lto_20081203_1.o link, -O0
-fwhopr
UNRESOLVED: g++.dg/lto/20081203 cp_lto_20081203_0.o-cp_lto_20081203_1.o execute
-O0 -fwhopr
FAIL: g++.dg/lto/20090311 cp_lto_20090311_0.o-cp_lto_20090311_1.o link, -O0
-fwhopr
UNRESOLVED: g++.dg/lto/20090311 cp_lto_20090311_0.o-cp_lto_20090311_1.o execute
-O0 -fwhopr
FAIL: g++.dg/lto/20090311 cp_lto_20090311_0.o-cp_lto_20090311_1.o link, -O2
-fwhopr
UNRESOLVED: g++.dg/lto/20090311 cp_lto_20090311_0.o-cp_lto_20090311_1.o execute
-O2 -fwhopr
FAIL: g++.dg/lto/20091210-1 cp_lto_20091210-1_0.o-cp_lto_20091210-1_1.o link,
-O0 -fwhopr
UNRESOLVED: g++.dg/lto/20091210-1 cp_lto_20091210-1_0.o-cp_lto_20091210-1_1.o
execute -O0 -fwhopr
FAIL: g++.dg/lto/20091210-1 cp_lto_20091210-1_0.o-cp_lto_20091210-1_1.o link,
-O2 -fwhopr
UNRESOLVED: g++.dg/lto/20091210-1 cp_lto_20091210-1_0.o-cp_lto_20091210-1_1.o
execute -O2 -fwhopr
FAIL: g++.dg/lto/20100723-1 cp_lto_20100723-1_0.o-cp_lto_20100723-1_0.o link,
-fcompare-debug -flto (internal compiler error)
UNRESOLVED: g++.dg/lto/20100723-1 cp_lto_20100723-1_0.o-cp_lto_20100723-1_0.o
execute -fcompare-debug -flto
FAIL: g++.dg/lto/20100723-1 cp_lto_20100723-1_0.o-cp_lto_20100723-1_0.o link,
-fcompare-debug -fwhopr (internal compiler error)
UNRESOLVED: g++.dg/lto/20100723-1 cp_lto_20100723-1_0.o-cp_lto_20100723-1_0.o
execute -fcompare-debug -fwhopr

Executing on host:
/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/gcc/testsuite/g++/../../g++
-B/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/gcc/testsuite/g++/../../
cp_lto_20081022_0.o cp_lto_20081022_1.o  -nostdinc++
-I/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/x86_64-apple-darwin10.5.0/i386/libstdc++-v3/include/x86_64-apple-darwin10.5.0
-I/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/x86_64-apple-darwin10.5.0/i386/libstdc++-v3/include
-I/sw/src/fink.build/gcc46-4.6.0-1000/gcc-4.6-20100826/libstdc++-v3/libsupc++
-I/sw/src/fink.build/gcc46-4.6.0-1000/gcc-4.6-20100826/libstdc++-v3/include/backward
-I/sw/src/fink.build/gcc46-4.6.0-1000/gcc-4.6-20100826/libstdc++-v3/testsuite/util
-fmessage-length=0 -O0 -fwhopr    
-L/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/x86_64-apple-darwin10.5.0/i386/libstdc++-v3/src/.libs

-B/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/x86_64-apple-darwin10.5.0/i386/libstdc++-v3/src/.libs

-L/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/x86_64-apple-darwin10.5.0/i386/libstdc++-v3/src/.libs
-L/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/x86_64-apple-darwin10.5.0/i386/libiberty
 -multiply_defined suppress     -m32 -o g++-dg-lto-20081022-01    (timeout =
300)
Undefined symbols:^M
  "__ZN3foo3barEv", referenced from:^M
      __Z1gP3foo in ccxsAxgO.ltrans0.ltrans.o^M
      __Z1fP3foo in ccxsAxgO.ltrans1.ltrans.o^M
ld: symbol(s) not found^M

On the positive side, all of the original non-relocatable subtraction
expression
errors are gone.


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (25 preceding siblings ...)
  2010-08-27 13:59 ` howarth at nitro dot med dot uc dot edu
@ 2010-08-27 14:14 ` howarth at nitro dot med dot uc dot edu
  2010-08-27 14:15 ` howarth at nitro dot med dot uc dot edu
                   ` (5 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-08-27 14:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #27 from howarth at nitro dot med dot uc dot edu  2010-08-27 14:13 -------
Created an attachment (id=21578)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21578&action=view)
corrected m32 darwin lto fix using external


-- 

howarth at nitro dot med dot uc dot edu changed:

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


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (26 preceding siblings ...)
  2010-08-27 14:14 ` howarth at nitro dot med dot uc dot edu
@ 2010-08-27 14:15 ` howarth at nitro dot med dot uc dot edu
  2010-08-27 17:38 ` iains at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-08-27 14:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #28 from howarth at nitro dot med dot uc dot edu  2010-08-27 14:15 -------
(In reply to comment #27)
> Created an attachment (id=21578)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21578&action=view) [edit]
> corrected m32 darwin lto fix using external
> 

My mistake. The additional assemble_external() calls weren't needed in
lto-cgraph.c and this reduced patch produces the same errors. Any idea of what
is happening to ltrans such that the symbols become undefined now?


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (27 preceding siblings ...)
  2010-08-27 14:15 ` howarth at nitro dot med dot uc dot edu
@ 2010-08-27 17:38 ` iains at gcc dot gnu dot org
  2010-09-01 14:39 ` howarth at nitro dot med dot uc dot edu
                   ` (3 subsequent siblings)
  32 siblings, 0 replies; 36+ messages in thread
From: iains at gcc dot gnu dot org @ 2010-08-27 17:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #29 from iains at gcc dot gnu dot org  2010-08-27 17:38 -------
(In reply to comment #12)
> Subject: Re:  m32 lto produces non-relocatable subtraction
>         expression errors
> 
> Hmm, actually the symbol is not changed, since it is externally visible symbol.
> I guess the problem would be that the symbol is used by 2 units, so both of
> them gets the declaration, but both of them gets the declaration with
> initializer (not extern).  To avoid duplicate definitions, varpool.c is testing
> in_other_partition and prevents calling assemble_variable on them. 

so one gets emitted and the other doesn't?

This works
> just fine on ELF since extern vars don't need to be announced.  

we don't need to announce them either ... (assemble_external() is a no-op).

Here we
> apparently need to get it assembled, but it is not getting via
> assemble_external.

we need to get the right entry into the machopic tables - if the var is local
to the TU ... 
> 
> Rebuilding the decl to DECL_EXTERN is probably possible, but somewhat hackish.

I guess this is just allowing it to be assembled... 

===

It is possible that the following is the root of the problem; 

when deciding how to output a var darwin/macho-pic takes the presence of an
initializer as evidence that the var is defined in the current TU and that,
therefore, it can reference it locally and doesn't need to output the other
stuff.  unless the var passes through assemble_var () this will not get done.

assemble_external () seems a bit hackish too...

I'm not clear why the two instances are not coalesced by the whopr process?
Is that to cater for file-scope vars?


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (28 preceding siblings ...)
  2010-08-27 17:38 ` iains at gcc dot gnu dot org
@ 2010-09-01 14:39 ` howarth at nitro dot med dot uc dot edu
  2010-09-01 14:42   ` Jan Hubicka
  2010-09-01 14:42 ` hubicka at ucw dot cz
                   ` (2 subsequent siblings)
  32 siblings, 1 reply; 36+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-09-01 14:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #30 from howarth at nitro dot med dot uc dot edu  2010-09-01 14:38 -------
Original -m32 lto testsuite failures due to "non-relocatable subtraction
expression" errors were made latent by the commit...

Author: ak
Date: Tue Aug 31 16:58:46 2010
New Revision: 163680

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

       * common.opt (fwhopr=): Update for -fwhopr=jobserver
       * doc/invoke.texi (fwhopr): Document -fwhopr=jobserver.
       * lto-wrapper.c (run_gcc): Add jobserver mode.
       * opts.c (common_handle_option): Fix OPT_fwhopr for non numeric
         argument.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/common.opt
    trunk/gcc/doc/invoke.texi
    trunk/gcc/lto-wrapper.c
    trunk/gcc/opts.c


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (29 preceding siblings ...)
  2010-09-01 14:39 ` howarth at nitro dot med dot uc dot edu
@ 2010-09-01 14:42 ` hubicka at ucw dot cz
  2010-09-03 12:27 ` hubicka at gcc dot gnu dot org
  2010-09-03 23:37 ` howarth at nitro dot med dot uc dot edu
  32 siblings, 0 replies; 36+ messages in thread
From: hubicka at ucw dot cz @ 2010-09-01 14:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #31 from hubicka at ucw dot cz  2010-09-01 14:42 -------
Subject: Re:  m32 lto produces non-relocatable subtraction
        expression errors

> Original -m32 lto testsuite failures due to "non-relocatable subtraction
> expression" errors were made latent by the commit...

Hmm, this does not make much sense. What changed?
Honza


-- 


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


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

* Re: [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-09-01 14:39 ` howarth at nitro dot med dot uc dot edu
@ 2010-09-01 14:42   ` Jan Hubicka
  0 siblings, 0 replies; 36+ messages in thread
From: Jan Hubicka @ 2010-09-01 14:42 UTC (permalink / raw)
  To: howarth at nitro dot med dot uc dot edu; +Cc: gcc-bugs

> Original -m32 lto testsuite failures due to "non-relocatable subtraction
> expression" errors were made latent by the commit...

Hmm, this does not make much sense. What changed?
Honza


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (30 preceding siblings ...)
  2010-09-01 14:42 ` hubicka at ucw dot cz
@ 2010-09-03 12:27 ` hubicka at gcc dot gnu dot org
  2010-09-03 23:37 ` howarth at nitro dot med dot uc dot edu
  32 siblings, 0 replies; 36+ messages in thread
From: hubicka at gcc dot gnu dot org @ 2010-09-03 12:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #32 from hubicka at gcc dot gnu dot org  2010-09-03 12:26 -------
Subject: Bug 44812

Author: hubicka
Date: Fri Sep  3 12:26:24 2010
New Revision: 163811

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

        PR lto/44812
        * lto-cgraph.c (intput_node, input_varpool_node): Set DECL_EXTERNAL
        on functions/variables in other partition.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/lto-cgraph.c


-- 


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


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

* [Bug lto/44812] m32 lto produces non-relocatable subtraction expression errors
  2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
                   ` (31 preceding siblings ...)
  2010-09-03 12:27 ` hubicka at gcc dot gnu dot org
@ 2010-09-03 23:37 ` howarth at nitro dot med dot uc dot edu
  32 siblings, 0 replies; 36+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-09-03 23:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #33 from howarth at nitro dot med dot uc dot edu  2010-09-03 23:36 -------
Fixed at r163811.


-- 

howarth at nitro dot med dot uc dot edu changed:

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


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


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

end of thread, other threads:[~2010-09-03 23:37 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-04 15:17 [Bug lto/44812] New: m32 lto produces non-relocatable subtraction expression errors howarth at nitro dot med dot uc dot edu
2010-07-04 15:23 ` [Bug lto/44812] " howarth at nitro dot med dot uc dot edu
2010-07-04 15:24 ` howarth at nitro dot med dot uc dot edu
2010-07-04 15:25 ` howarth at nitro dot med dot uc dot edu
2010-07-15 13:20 ` howarth at nitro dot med dot uc dot edu
2010-08-24 13:01 ` hubicka at gcc dot gnu dot org
2010-08-24 13:17 ` dominiq at lps dot ens dot fr
2010-08-24 13:44 ` hubicka at gcc dot gnu dot org
2010-08-24 13:44 ` howarth at nitro dot med dot uc dot edu
2010-08-24 13:47 ` iains at gcc dot gnu dot org
2010-08-24 14:11 ` iains at gcc dot gnu dot org
2010-08-24 14:37 ` iains at gcc dot gnu dot org
2010-08-24 15:04   ` Jan Hubicka
2010-08-24 15:05 ` hubicka at ucw dot cz
2010-08-24 15:17 ` iains at gcc dot gnu dot org
2010-08-24 15:40 ` howarth at nitro dot med dot uc dot edu
2010-08-26  1:40 ` howarth at nitro dot med dot uc dot edu
2010-08-26  1:55 ` howarth at nitro dot med dot uc dot edu
2010-08-26 10:19 ` howarth at nitro dot med dot uc dot edu
2010-08-26 16:01 ` howarth at nitro dot med dot uc dot edu
2010-08-26 20:03 ` dominiq at lps dot ens dot fr
2010-08-27  0:09 ` dominiq at lps dot ens dot fr
2010-08-27  0:42 ` howarth at nitro dot med dot uc dot edu
2010-08-27  0:44 ` howarth at nitro dot med dot uc dot edu
2010-08-27 10:31 ` dominiq at lps dot ens dot fr
2010-08-27 12:10 ` howarth at nitro dot med dot uc dot edu
2010-08-27 13:54 ` howarth at nitro dot med dot uc dot edu
2010-08-27 13:59 ` howarth at nitro dot med dot uc dot edu
2010-08-27 14:14 ` howarth at nitro dot med dot uc dot edu
2010-08-27 14:15 ` howarth at nitro dot med dot uc dot edu
2010-08-27 17:38 ` iains at gcc dot gnu dot org
2010-09-01 14:39 ` howarth at nitro dot med dot uc dot edu
2010-09-01 14:42   ` Jan Hubicka
2010-09-01 14:42 ` hubicka at ucw dot cz
2010-09-03 12:27 ` hubicka at gcc dot gnu dot org
2010-09-03 23:37 ` howarth at nitro dot med dot uc dot edu

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