This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug optimization/11994] New: vax-netbsd build segfaults on unwind-dw2.c


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: vax-netbsd build segfaults on unwind-dw2.c
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dhazeghi at yahoo dot com
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: vax-netbsd

When building a cross (mainline 20030820) to vax-netbsd, build dies with:

./xgcc -B./ -B/tmp/dara//vax-netbsd/bin/ -isystem /tmp/dara//vax-netbsd/include
-isystem /tmp/dara//vax-netbsd/sys-include -L/tmp/mainline/objdir/gcc/../ld -O2
 -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes
-Wmissing-prototypes -isystem ./include   -g  -DIN_LIBGCC2
-D__GCC_FLOAT_NOT_NEEDED  -I. -I. -I../../gcc/gcc -I../../gcc/gcc/.
-I../../gcc/gcc/config -I../../gcc/gcc/../include  -fexceptions -c
../../gcc/gcc/unwind-dw2.c -o libgcc/./unwind-dw2.o
In file included from ../../gcc/gcc/unwind-dw2.c:37:
../../gcc/gcc/unwind-pe.h: In function `size_of_encoded_value':

../../gcc/gcc/unwind-pe.h:88: internal compiler error: Segmentation fault

If the optimization level is decreases to -O1 or lower, the crash goes away.

Here's the testcase (it seems very fragile):

#define DW_EH_PE_absptr         0x00
#define DW_EH_PE_omit           0xff

#define DW_EH_PE_udata2         0x02
#define DW_EH_PE_udata4         0x03
#define DW_EH_PE_udata8         0x04

static unsigned int
size_of_encoded_value (unsigned char encoding)
{

  switch (encoding & 0x07)
    {
    case DW_EH_PE_absptr:
      return sizeof (void *);
    case DW_EH_PE_udata2:
      return 2;
    case DW_EH_PE_udata4:
    case DW_EH_PE_udata8:
      return 8;
    }
  __gxx_abort ();
}


This can be reproduced just with a cross cc1.

Here's the backtrace:
#0  label_is_jump_target_p (label=0x40161280, jump_insn=0x401a2d00)
    at ../../gcc/gcc/cfgcleanup.c:643
#1  0x08205ccd in try_optimize_cfg (mode=256) at ../../gcc/gcc/cfgcleanup.c:1720
#2  0x08205de1 in cleanup_cfg (mode=256) at ../../gcc/gcc/cfgcleanup.c:1891
#3  0x080b93ba in cfg_layout_initialize () at ../../gcc/gcc/cfglayout.c:1128
#4  0x081ffbdb in reorder_basic_blocks () at ../../gcc/gcc/bb-reorder.c:1067
#5  0x081d1c2d in rest_of_handle_reorder_blocks (decl=0x401a0b64, 
    insns=0x4015e3e0) at ../../gcc/gcc/toplev.c:2201
#6  0x081d3805 in rest_of_compilation (decl=0x401a0b64)
    at ../../gcc/gcc/toplev.c:3401
#7  0x08063a9f in c_expand_body_1 (fndecl=0x401a0b64, nested_p=0)
    at ../../gcc/gcc/c-decl.c:6329
#8  0x08063ec8 in c_expand_body (fndecl=0x401a0b64) at ../../gcc/gcc/c-decl.c:6411
#9  0x08063692 in finish_function (nested=0, can_defer_p=1)
    at ../../gcc/gcc/c-decl.c:6199
#10 0x0804a3cb in yyparse () at c-parse.y:385
#11 0x0804e417 in c_parse_file () at c-parse.y:3015
#12 0x0808754d in c_common_parse_file (set_yydebug=1)
    at ../../gcc/gcc/c-opts.c:1210
#13 0x081d1222 in compile_file () at ../../gcc/gcc/toplev.c:1730
#14 0x081d4cec in do_compile () at ../../gcc/gcc/toplev.c:4407
#15 0x081d4dc5 in toplev_main (argc=3, argv=0xbffff104)
    at ../../gcc/gcc/toplev.c:4447
#16 0x080a0dbb in main (argc=3, argv=0xbffff104) at ../../gcc/gcc/main.c:35


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]