public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "davek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/46671] [4.6 Regression] ICE in default_no_named_section, at varasm .c:5994
Date: Sat, 04 Dec 2010 05:37:00 -0000	[thread overview]
Message-ID: <bug-46671-4-IAYlVwORDt@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-46671-4@http.gcc.gnu.org/bugzilla/>

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?


  parent reply	other threads:[~2010-12-04  5:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-26  7:32 [Bug middle-end/46671] New: " danglin at gcc dot gnu.org
2010-11-26 10:33 ` [Bug middle-end/46671] " rguenth at gcc dot gnu.org
2010-11-27  5:36 ` danglin at gcc dot gnu.org
2010-11-27  5:51 ` danglin at gcc dot gnu.org
2010-11-29 13:36 ` ro at gcc dot gnu.org
2010-12-02  3:20 ` danglin at gcc dot gnu.org
2010-12-03 15:22 ` ro at CeBiTec dot Uni-Bielefeld.DE
2010-12-03 17:22 ` dave at hiauly1 dot hia.nrc.ca
2010-12-04  5:37 ` davek at gcc dot gnu.org [this message]
2010-12-06 12:47 ` jakub at gcc dot gnu.org
2010-12-06 17:27 ` davek at gcc dot gnu.org
2010-12-08  1:27 ` danglin at gcc dot gnu.org
2010-12-08 12:29 ` jakub at gcc dot gnu.org
2010-12-08 13:29 ` ro at gcc dot gnu.org
2010-12-08 16:49 ` jakub at gcc dot gnu.org
2010-12-12 20:38 ` hubicka at gcc dot gnu.org
2010-12-15 10:25 ` ro at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-46671-4-IAYlVwORDt@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).