Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 22313
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: bero@arklinux.org
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
attribs.i.bz2 preprocessed source application/x-bzip2 2005-07-05 18:37 58.88 KB Edit
attribs.s.bz2 Generated asm code application/x-bzip2 2005-07-05 18:39 26.11 KB Edit
c-lex.i.bz2 Preprocessed source of code triggering this in current 4.1 SVN application/x-bzip2 2006-01-17 19:35 68.49 KB Edit
c-lex.s.bz2 asm code generated by current 4.1 SVN application/x-bzip2 2006-01-17 19:36 34.15 KB Edit
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 22313 depends on: 25518 Show dependency tree
Show dependency graph
Bug 22313 blocks: 24934

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2006-06-05 10:19 Opened: 2005-07-05 18:36
SSIA. 
Building with gcc 3.4.4, binutils 2.16.1 (tried 2.16.91.0.1 too, same 
behavior) results in 
 
stage1/xgcc -Bstage1/ -B/usr/i586-ark-linux/bin/ -c   -g -O2 -fprofile-use  
-freorder-blocks-and-partition -DIN_GCC   -W -Wall -Wwrite-strings  
-Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long  
-Wno-variadic-macros -Wold-style-definition -Werror -fno-common    
-DHAVE_CONFIG_H    -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include  
-I../../gcc/../libcpp/include  ../../gcc/attribs.c -o attribs.o  
/tmp/ccHE8Qe5.s: Assembler messages:  
/tmp/ccHE8Qe5.s:1539: Error: invalid sections for operation on `.LCFI11' and  
`.LCFI10'  
make[2]: *** [attribs.o] Error 1

------- Comment #1 From bero@arklinux.org 2005-07-05 18:37 -------
Created an attachment (id=9208) [edit]
preprocessed source

------- Comment #2 From bero@arklinux.org 2005-07-05 18:39 -------
Created an attachment (id=9209) [edit]
Generated asm code

------- Comment #3 From Pawel Sikora 2005-07-26 18:32 -------
imho the code is good. assembler should converts the local 
references into relocs off the .text section. 
 
        .section .rodata 
.zoo:   .long .foo-.zoo 
        .section .text 
.foo:   nop 
 
Disassembly of section .text: 
 
00000000 <.foo>: 
   0:   90                      nop 
 
RELOCATION RECORDS FOR [.rodata]: 
OFFSET   TYPE              VALUE 
00000000 R_386_PC32        .text 
 
(binutils-2.15.94.0.2.2) 
 

------- Comment #4 From Andrew Pinski 2005-08-20 22:18 -------
*** Bug 23502 has been marked as a duplicate of this bug. ***

------- Comment #5 From Andrew Pinski 2005-08-20 22:20 -------
Actually this effects x86_64 only or if you have a local patch to turn on omit
frame pointer all the time 
and -fasynchronous-unwind-tables which is why only x86_64 is effected on a pure
sources.

------- Comment #6 From Andrew Pinski 2005-09-08 19:49 -------
This works for me with binutils 2.15.

------- Comment #7 From Ian Lance Taylor 2005-10-05 23:36 -------
This is not a bug in the assembler.  The attached assembler code is trying to
put the difference between a symbol in the .text section (.LCFI10) and the
.text.unlikely section (.LCFI11) into the .debug_frame section.  There is no
way to represent such a relocation in ELF.  It would require the relocation to
specify two different symbols, which can not be done in ELF, or it would
require a paired relocation, which is not supported for x86_64 ELF.

Comment #3 is incorrect as it refers to the special case in which the computed
difference is being put into the same section as the subtrahend symbol.  That
case does not apply here.

------- Comment #8 From Andrew Pinski 2005-10-06 00:24 -------
(In reply to comment #5)
> Actually this effects x86_64 only or if you have a local patch to turn on omit
> frame pointer all the time 
> and -fasynchronous-unwind-tables which is why only x86_64 is effected on a pure
> sources.

Actually this is on x86-linux-gnu with a newer binutils, I don't know why I
attributed it to x86_64 for some reason, which means it is not related at all
to -fasynchronous-unwind-tables.

------- Comment #9 From Andrew Pinski 2005-10-06 00:32 -------
Closing as works for me, this works for me and it worked for Honza on
2005-09-28, see PR 23396, comment #5.

Plus 2.15 errored out with your .s file.  So it looks like one of your local
patches were breaking this.

------- Comment #10 From bero@arklinux.org 2005-10-10 21:48 -------
This is still reproducable here [with unpatched sources], using binutils 2.16.1
and gcc 3.4.4 to compile the stage1 compiler

------- Comment #11 From Mark Loeser 2005-11-06 20:29 -------
This is reproducable on gcc mainline on amd64:

{standard input}: Assembler messages:
{standard input}:510: Error: can't resolve `.text.unlikely' {.text.unlikely
section} - `.LFB96' {.text section}

Building gcc-4.1.0_beta20051105 with gcc-4.0.2, with binutils 2.16.91.0.3. 
Same error with binutils-2.16.1 as well.

------- Comment #12 From Andrew Pinski 2005-11-09 16:29 -------
(In reply to comment #11)
> This is reproducable on gcc mainline on amd64:
This works for me with "GNU assembler 2.16.91 20051027" with the GCC mainline
on i686-linux-gnu
And with "GNU assembler 2.16" with the GCC mainline on x86_64-linux-gnu.

------- Comment #13 From Mark Loeser 2005-11-11 17:52 -------
You should be able to reproduce this by setting BOOT_CFLAGS="-O2".  Eliminating
that allows me to successfully compile gcc-4.1 on x86_64.

------- Comment #14 From Andrew Pinski 2005-11-11 18:50 -------
This is a bug still.

------- Comment #15 From Andrew Pinski 2005-11-11 18:50 -------
so with -g, it works but without -g it does not.

------- Comment #16 From Andrew Pinski 2005-11-11 19:01 -------
The problem is that dwarf2out_switch_text_section does not get called as the
debug_hooks are set to none.

So the handling of NOTE_INSN_SWITCH_TEXT_SECTIONS is slightly wrong for this
case.  Looking more into it.

------- Comment #17 From Andrew Pinski 2005-11-11 19:10 -------
Testing a fix for the with/without -g problem.

------- Comment #18 From Andrew Pinski 2005-11-11 20:14 -------
Patch posted for the x86_64 failure:
http://gcc.gnu.org/ml/gcc-patches/2005-11/msg00857.html

For the i686 failure, I don't know since I was not able to reproduce that.

------- Comment #19 From Papadakos Panagiotis 2005-11-23 19:37 -------
I don't know if this is related, but I can't compile make profiledbootstrap
on a x86 Linux. Stops in attribs.c. I don't know if it is related to this bug
but you can find more info in http://gcc.gnu.org/ml/gcc/2005-11/msg00906.html

------- Comment #20 From Steven Bosscher 2005-12-16 22:46 -------
Review mail was here: http://gcc.gnu.org/ml/gcc-patches/2005-12/msg00121.html

------- Comment #21 From Mark Mitchell 2005-12-19 17:55 -------
This is a bootstrap failure, and there is an approved patch, so this should be
fixed before release: P1.

------- Comment #22 From Andrew Pinski 2005-12-20 03:58 -------
Test this again on the 4.1 branch and then will apply it there, the mainline
currently ignores BOOT_CFLAGS so I cannot test it there.

------- Comment #23 From Andrew Pinski 2005-12-20 04:53 -------
Subject: Bug 22313

Author: pinskia
Date: Tue Dec 20 04:53:06 2005
New Revision: 108839

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108839
Log:
2005-12-19  Andrew Pinski  <pinskia@physics.uc.edu>

        PR middle-end/22313
        * dwarf2out.c (dwarf2out_switch_text_section): Export.
        * debug.h (dwarf2out_switch_text_section): Prototype.
        * final.c (final_scan_insn): Call dwarf2out_switch_text_section
        if we need to call it for dwarf2 unwind info.


Forgot the PR number

Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog

------- Comment #24 From Andrew Pinski 2005-12-20 04:53 -------
Fixed on the 4.1 branch, will test the mainline with --disable-bootstrap since
that caused BOOT_CFLAGS to be ignored.

------- Comment #25 From Andrew Pinski 2005-12-20 06:46 -------
This is now broken even with -g on the mainline so unassigning.

------- Comment #26 From Papadakos Panagiotis 2005-12-20 16:07 -------
I still can't profiledbootstrap gcc 4.1 branch. Stops with the following
message:

tage1/xgcc -Bstage1/ -B/usr/gcc_4_1/i486-slackware-linux/bin/ -c   -O2 -g
-fomit-frame-pointer -fprofile-use -freorder-blocks-and-partition -DIN_GCC   -W
-Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic
-Wno-long-long -Wno-variadic-macros -Wold-style-definition
-Wmissing-format-attribute     -DHAVE_CONFIG_H -I. -I.
-I../../gcc-4_1-branch/gcc -I../../gcc-4_1-branch/gcc/.
-I../../gcc-4_1-branch/gcc/../include
-I../../gcc-4_1-branch/gcc/../libcpp/include    
../../gcc-4_1-branch/gcc/attribs.c -o attribs.o
/tmp/ccXgVrwC.s: Assembler messages:
/tmp/ccXgVrwC.s:1280: Error: invalid sections for operation on `.LCFI71' and
`.LCFI70'
make[2]: *** [attribs.o] Error 1

This is with binutils 2.16.91.0.4 20051111
and gcc version 4.0.3 20051207 (prerelease)
on a linux x86 machine.

------- Comment #27 From bero@arklinux.org 2006-01-17 19:34 -------
Still breaks for me on 4.1 branch too (4.1 branch SVN ID 109831).
Linux x86, binutils 2.16.91.0.4

The error is related but slightly different and on a different file these days:

c-errors.c -o c-errors.o
stage1/xgcc -Bstage1/ -B/usr/i586-ark-linux/bin/ -c   -g -O2 -fprofile-use
-freorder-blocks-and-partition -DIN_GCC   -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long
-Wno-variadic-macros -Wold-style-definition -Wmissing-format-attribute    
-DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include
-I../../gcc/../libcpp/include     ../../gcc/c-lex.c -o c-lex.o
/tmp/ccMLYhJE.s: Assembler messages:
/tmp/ccMLYhJE.s:2979: Error: invalid sections for operation on `.LCFI22' and
`.LCFI21'
/tmp/ccMLYhJE.s:3048: Error: invalid sections for operation on `.LCFI38' and
`.LCFI37'
/tmp/ccMLYhJE.s:3242: Error: invalid sections for operation on `.LCFI76' and
`.LCFI75'
/tmp/ccMLYhJE.s:3279: Error: invalid sections for operation on `.LCFI83' and
`.LCFI82'

------- Comment #28 From bero@arklinux.org 2006-01-17 19:35 -------
Created an attachment (id=10664) [edit]
Preprocessed source of code triggering this in current 4.1 SVN

------- Comment #29 From Andrew Pinski 2006-01-17 19:36 -------
(In reply to comment #27)
> Still breaks for me on 4.1 branch too (4.1 branch SVN ID 109831).
> Linux x86, binutils 2.16.91.0.4

Can you file a different bug and attach the .s file?  Because I don't see this
at all.  Also can you try with a FSF release of binutils and not some hacked up
version?

------- Comment #30 From bero@arklinux.org 2006-01-17 19:36 -------
Created an attachment (id=10665) [edit]
asm code generated by current 4.1 SVN

------- Comment #31 From Andrew Pinski 2006-03-03 18:25 -------
I am going to apply my patch to the mainline in the next or two,  I will make
sure I also apply my follow up patch too.

------- Comment #32 From Andrew Pinski 2006-03-08 00:01 -------
And now profiledbootstrap is broken a different way on the mainline so I am not
fixing this.

------- Comment #33 From Andrew Pinski 2006-04-03 22:05 -------
*** Bug 27011 has been marked as a duplicate of this bug. ***

------- Comment #34 From Alexandre Oliva 2006-05-29 09:15 -------
I've completed a successful profiledbootstrap on amd64-linux-gnu last night. 
Is anyone else still seeing this, or is it fixed?

------- Comment #35 From Peter Doerfler 2006-05-29 09:39 -------
FWIW profiledbootstrap still fails with -march=pentium4 and fortran enabled
because of PR26449.
Last tested with 20060520.

------- Comment #36 From Papadakos Panagiotis 2006-05-29 12:23 -------
Still have this problen on x86 with latest gcc-4.1 SVN branch and
binutils 2.16.91.0.7.

stage1/xgcc -Bstage1/ -B/usr/i486-slackware-linux/bin/ -c   -O2 -g
-fomit-frame-pointer -fprofile-use -freorder-blocks-and-partition -DIN_GCC   -W
-Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic
-Wno-long-long -Wno-variadic-macros -Wold-style-definition
-Wmissing-format-attribute     -DHAVE_CONFIG_H -I. -I.
-I../../gcc-4.1-branch/gcc -I../../gcc-4.1-branch/gcc/.
-I../../gcc-4.1-branch/gcc/../include
-I../../gcc-4.1-branch/gcc/../libcpp/include    
../../gcc-4.1-branch/gcc/attribs.c -o attribs.o
/tmp/ccoORGHT.s: Assembler messages:
/tmp/ccoORGHT.s:1280: Error: invalid sections for operation on `.LCFI71' and
`.LCFI70'
make[2]: *** [attribs.o] Error 1
make[2]: Leaving directory `/root/SVN/GCC/build/gcc'
make[1]: *** [stagefeedback_build] Error 2
make[1]: Leaving directory `/root/SVN/GCC/build/gcc'
make: *** [profiledbootstrap] Error 2

------- Comment #37 From roger@eyesopen.com 2006-07-17 22:15 -------
I've now tested "make profiledbootstrap" on both mainline and the
gcc-4_1-branch,
on both x86_64-unknown-linux-gnu and i686-pc-linux-gnu, and not only does the
profiled bootstrap build fine, but the dejagnu testsuite looks identical to a
baseline "make bootstrap".

Could anyone confirm whether they're still seeing this problem?  Its likely
that Andrew Pinski's patches together with the resolution of PRs 25518 and
26449 have now resolved this issue.

------- Comment #38 From Papadakos Panagiotis 2006-07-17 23:19 -------
Unfortunately I still have the same problem..
Don't know if I am the only one!
This is during compiling gcc 4.1 SVN trunk

GNU ld version 2.16.91.0.7 20060317

gcc -v
Using built-in specs.
Target: i486-slackware-linux
Configured with: ../gcc-4.1-branch/configure --prefix=/usr --enable-shared
--enable-threads=posix --enable-__cxa_atexit --disable-checking --with-gnu-ld
--verbose --target=i486-slackware-linux --host=i486-slackware-linux
Thread model: posix
gcc version 4.1.2 20060601 (prerelease)

stage1/xgcc -Bstage1/ -B/usr/i486-slackware-linux/bin/ -c   -O2 -g
-fomit-frame-pointer -fprofile-use -freorder-blocks-and-partition -DIN_GCC   -W
-Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic
-Wno-long-long -Wno-variadic-macros -Wold-style-definition
-Wmissing-format-attribute     -DHAVE_CONFIG_H -I. -I.
-I../../gcc-4.1-branch/gcc -I../../gcc-4.1-branch/gcc/.
-I../../gcc-4.1-branch/gcc/../include
-I../../gcc-4.1-branch/gcc/../libcpp/include    
../../gcc-4.1-branch/gcc/c-lang.c -o c-lang.o
stage1/xgcc -Bstage1/ -B/usr/i486-slackware-linux/bin/ -c   -O2 -g
-fomit-frame-pointer -fprofile-use -freorder-blocks-and-partition -DIN_GCC   -W
-Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic
-Wno-long-long -Wno-variadic-macros -Wold-style-definition
-Wmissing-format-attribute     -DHAVE_CONFIG_H -I. -I.
-I../../gcc-4.1-branch/gcc -I../../gcc-4.1-branch/gcc/.
-I../../gcc-4.1-branch/gcc/../include
-I../../gcc-4.1-branch/gcc/../libcpp/include    
../../gcc-4.1-branch/gcc/stub-objc.c -o stub-objc.o
stage1/xgcc -Bstage1/ -B/usr/i486-slackware-linux/bin/ -c   -O2 -g
-fomit-frame-pointer -fprofile-use -freorder-blocks-and-partition -DIN_GCC   -W
-Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic
-Wno-long-long -Wno-variadic-macros -Wold-style-definition
-Wmissing-format-attribute     -DHAVE_CONFIG_H -I. -I.
-I../../gcc-4.1-branch/gcc -I../../gcc-4.1-branch/gcc/.
-I../../gcc-4.1-branch/gcc/../include
-I../../gcc-4.1-branch/gcc/../libcpp/include    
../../gcc-4.1-branch/gcc/attribs.c -o attribs.o
/tmp/ccqSKDxK.s: Assembler messages:
/tmp/ccqSKDxK.s:1280: Error: invalid sections for operation on `.LCFI71' and
`.LCFI70'

------- Comment #39 From roger@eyesopen.com 2006-07-24 00:45 -------
My latest analysis and a possible patch/workaround have been posted here:
http://gcc.gnu.org/ml/gcc-patches/2006-07/msg01015.html

------- Comment #40 From Jan Hubicka 2006-08-07 08:18 -------
Roger,
the patch for advance loc seems sane solution to me (in my limited
understanding
of dwarf2). 

If I understand it right, we need the advance_loc only when crossing the
section boundary, so we ought to be able to use NOTE_INSN_SWITCH_TEXT_SECTIONS
and use the advance_loc only when tripping over it.  Only anoying thing would
be probably to get it passed out of final.c up to the offending place.

Thanks for looking into this,
Honza

------- Comment #41 From Roger Sayle 2006-08-31 17:35 -------
Subject: Bug 22313

Author: sayle
Date: Thu Aug 31 17:35:32 2006
New Revision: 116604

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

        PR other/22313
        * dwarf2out.c (add_fde_cfi): Use a set_loc if the current label is
        NULL, otherwise use an advance_loc4 to adjust relative to the 
        current label.
        (output_cfi) <DW_CFA_set_loc>: Update the current label.
        (dwarf2out_switch_text_section): Reset the current label to avoid
        using advance_loc4 over section boundaries.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/dwarf2out.c

------- Comment #42 From Andrew Pinski 2006-08-31 17:53 -------
Fixed.

------- Comment #43 From Roger Sayle 2006-09-01 15:47 -------
Subject: Bug 22313

Author: sayle
Date: Fri Sep  1 15:47:29 2006
New Revision: 116628

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

        PR other/22313
        * dwarf2out.c (add_fde_cfi): Use a set_loc if the current label is
        NULL, otherwise use an advance_loc4 to adjust relative to the 
        current label.
        (output_cfi) <DW_CFA_set_loc>: Update the current label.
        (dwarf2out_switch_text_section): Reset the current label to avoid
        using advance_loc4 over section boundaries.


Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/dwarf2out.c

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug