http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46671
Dave Korn <davek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |davek at gcc dot gnu.org --- Comment #7 from Dave Korn <davek at gcc dot gnu.org> 2010-12-04 05:36:36 UTC --- I think this may also have caused FAIL: g++.dg/debug/debug9.C (test for excess errors) on i686-pc-cygwin. I get all sorts of assembler complaints: /gnu/gcc/obj-pr40125/gcc/testsuite/g++/../../g++ -B/gnu/gcc/obj-pr40125/gcc/testsuite/g++/../../ -nostdinc++ -I/gnu/gcc/obj-pr40125/i686-pc-cygwin/libstdc++-v3/include/i686-pc-cygwin -I/gnu/gcc/obj-pr40125/i686-pc-cygwin/libstdc++-v3/include -I/gnu/gcc/gcc-patched/libstdc++-v3/libsupc++ -I/gnu/gcc/gcc-patched/libstdc++-v3/include/backward -I/gnu/gcc/gcc-patched/libstdc++-v3/testsuite/util -fmessage-length=0 -gcoff3 -O2 -c -o debug9.o /gnu/gcc/gcc-patched/gcc/testsuite/g++.dg/debug/debug9.C /win/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccaVQnkC.s: Assembler messages: /win/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccaVQnkC.s:61: Error: CFI instruction used without previous .cfi_startproc /win/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccaVQnkC.s:62: Error: CFI instruction used without previous .cfi_startproc /win/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccaVQnkC.s:63: Error: CFI instruction used without previous .cfi_startproc /win/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccaVQnkC.s:65: Error: CFI instruction used without previous .cfi_startproc /win/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccaVQnkC.s:67: Error: CFI instruction used without previous .cfi_startproc /win/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccaVQnkC.s:69: Error: CFI instruction used without previous .cfi_startproc /win/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccaVQnkC.s:71: Error: CFI instruction used without previous .cfi_startproc /win/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccaVQnkC.s:75: Error: CFI instruction used without previous .cfi_startproc /win/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccaVQnkC.s:135: Error: .cfi_endproc without corresponding .cfi_startproc /win/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccaVQnkC.s:178: Error: open CFI at the end of file; missing .cfi_endproc directive compiler exited with status 1 ... and these are caused because we're hopping around between .text and .text.startup, and we do so: .file "debug9.C" .text .def _s; .scl 10; .type 010; .size 1; .endef .def .eos; .val 1; .scl 102; .tag _s; .size 1; .endef .def _s; .scl 13; .tag _s; .size 1; .type 010; .endef .def ___main; .scl 2; .type 32; .endef .section .text.startup,"x" .p2align 4,,15 .text .def _main; .val _main; .scl 2; .type 044; .endef .globl _main _main: .def .bf; .val .; .scl 101; .line 23; .endef .section .text.startup,"x" LFB1: .cfi_startproc .cfi_personality 0,___gxx_personality_v0 .cfi_lsda 0,LLSDA1 leal 4(%esp), %ecx .cfi_def_cfa 1, 0 andl $-16, %esp pushl -4(%ecx) pushl %ebp movl %esp, %ebp .cfi_escape 0x10,0x5,0x2,0x75,0 pushl %esi pushl %ebx pushl %ecx .cfi_escape 0xf,0x3,0x75,0x74,0x6 .cfi_escape 0x10,0x3,0x2,0x75,0x78 .cfi_escape 0x10,0x6,0x2,0x75,0x7c subl $44, %esp .ln 1 call ___main .def .bb; .val .; .scl 100; .line 1; .endef .def .bb; .val .; .scl 100; .line 1; .endef .text ... here, right in the middle of an open CFI. GAS can't handle this even if we were to switch back to the original section anyway, but in this case it's even worse: .def _c; .val -26; .scl 1; .tag _s; .size 1; .type 010; .endef leal -26(%ebp), %ebx leal -25(%ebp), %esi ... as we end up carrying on code generation in a different section. Urk! This test is compiled with -gcoff in effect, and the problematic switch back to the .text section is generated in sdbout.c#sdbout_one_type(), right here at the start: static void sdbout_one_type (tree type) { if (current_function_decl != NULL_TREE && DECL_SECTION_NAME (current_function_decl) != NULL_TREE) ; /* Don't change section amid function. */ else switch_to_section (text_section); For some reason this doesn't realise that we may be in a section other than the .text section any more. current_function_decl points to main() at the time of the problem, but DECL_SECTION_NAME is indeed null. Honza, any ideas how to teach it about the new sections?