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 c/12279] New: VAX casesi causes ICE


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

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

           Summary: VAX casesi causes ICE
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: matt at 3am-software dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i386--netbsdelf
  GCC host triplet: i386--netbsdelf
GCC target triplet: vax--netbsdelf

typedef long unsigned int size_t;
int snprintf (char * __restrict, size_t, const char * __restrict, ...)
     __attribute__((__format__(__printf__, 3, 4)));

int
outfmt(char *obuf, size_t len, char fmt, double b)
{
    switch (fmt) {
 case 'G':
     return snprintf(obuf, len, "%.2f GB", b / 1024.0 / 1024.0 / 1024.0);
     break;
 default:
 case 'K':
     return snprintf(obuf, len, "%.2f KB", b / 1024.0);
     break;
 case 'M':
     return snprintf(obuf, len, "%.2f MB", b / 1024.0 / 1024.0);
     break;
 case 'g':
     return snprintf(obuf, len, "%.2f Gbit", b * 8.0 / 1024.0 / 1024.0 / 1024.0);
     break;
 case 'k':
     return snprintf(obuf, len, "%.2f Kbit", b * 8.0 / 1024.0);
     break;
 case 'm':
     return snprintf(obuf, len, "%.2f Mbit", b * 8.0 / 1024.0 / 1024.0);
     break;
    }
}

Compiling that via:
./xgcc -S -O2 -B./ -v -c /tmp/x.i 
Reading specs from ./specs
Configured with: '/u2/toolchain/gcc/configure' '--target=vax--netbsdelf : (reconfigured) '/u2/
toolchain/gcc/configure' '--target=vax--netbsdelf '--disable-multilib
Thread model: single
gcc version 3.4 20030913 (experimental)
 ./cc1 -fpreprocessed /tmp/x.i -quiet -dumpbase x.i -auxbase x -O2 -version -o x.s
GNU C version 3.4 20030913 (experimental) (vax--netbsdelf)
        compiled by GNU C version 2.95.3 20010315 (release) (NetBSD nb4).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
/tmp/x.i: In function `outfmt':

/tmp/x.i:29: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

#0  0x837f348 in label_is_jump_target_p (label=0x484fe5f0, 
    jump_insn=0x48574580) at /u2/toolchain/gcc/gcc/cfgcleanup.c:665
#1  0x838107c in try_optimize_cfg (mode=256)
    at /u2/toolchain/gcc/gcc/cfgcleanup.c:1715
#2  0x838157c in cleanup_cfg (mode=256)
    at /u2/toolchain/gcc/gcc/cfgcleanup.c:1915
#3  0x8124587 in cfg_layout_initialize ()
    at /u2/toolchain/gcc/gcc/cfglayout.c:1128
#4  0x8378131 in reorder_basic_blocks ()
    at /u2/toolchain/gcc/gcc/bb-reorder.c:1067
#5  0x8324c6b in rest_of_handle_reorder_blocks (decl=0x48573870, 
    insns=0x484fb440) at /u2/toolchain/gcc/gcc/toplev.c:2280
#6  0x83270ff in rest_of_compilation (decl=0x48573870)
    at /u2/toolchain/gcc/gcc/toplev.c:3481
#7  0x83717c3 in tree_rest_of_compilation (fndecl=0x48573870, 
    nested_p=0 '\000') at /u2/toolchain/gcc/gcc/tree-optimize.c:165
#8  0x807cbf3 in c_expand_body_1 (fndecl=0x48573870, nested_p=0)
    at /u2/toolchain/gcc/gcc/c-decl.c:6190
#9  0x807cdf8 in c_expand_body (fndecl=0x48573870)
    at /u2/toolchain/gcc/gcc/c-decl.c:6220
#10 0x8373fa5 in cgraph_expand_function (node=0x48577360)
    at /u2/toolchain/gcc/gcc/cgraphunit.c:481
#11 0x8375c0b in cgraph_expand_functions ()
    at /u2/toolchain/gcc/gcc/cgraphunit.c:1224
#12 0x8375e20 in cgraph_optimize () at /u2/toolchain/gcc/gcc/cgraphunit.c:1288
#13 0x80e495b in c_objc_common_finish_file ()
    at /u2/toolchain/gcc/gcc/c-objc-common.c:249
#14 0x8056bb3 in finish_file () at /u2/toolchain/gcc/gcc/c-lang.c:231
#15 0x80d5ab6 in c_common_parse_file (set_yydebug=0)
    at /u2/toolchain/gcc/gcc/c-opts.c:1216
#16 0x8323ebb in compile_file () at /u2/toolchain/gcc/gcc/toplev.c:1792
#17 0x83289e0 in do_compile () at /u2/toolchain/gcc/gcc/toplev.c:4484
#18 0x8328a79 in toplev_main (argc=3, argv=0xbfbffaf8)
    at /u2/toolchain/gcc/gcc/toplev.c:4524
#19 0x80f6682 in main (argc=3, argv=0xbfbffaf8)
    at /u2/toolchain/gcc/gcc/main.c:35
#20 0x8049a94 in ___start ()

line 664 is returning a bogus value for vec
664           rtvec vec = XVEC (tmp, GET_CODE (tmp) == ADDR_DIFF_VEC);
(gdb) print vec
$1 = 0x85

(gdb) print debug_rtx (jump_insn)
(jump_insn 131 130 15 0 /tmp/x.c:9 (set (pc)
        (if_then_else (leu (minus:SI (reg:SI 0 %r0 [orig:69 fmt ] [69])
                    (const_int 71 [0x47]))
                (const_int 38 [0x26]))
            (plus:SI (sign_extend:SI (mem:HI (plus:SI (mult:SI (minus:SI (reg:SI 0 %r0 [orig:69 fmt ] [69])
                                    (const_int 71 [0x47]))
                                (const_int 2 [0x2]))
                            (pc)) [0 S2 A8]))
                (label_ref:SI 132))
            (pc))) 142 {casesi1} (insn_list 130 (nil))
    (expr_list:REG_DEAD (reg:SI 0 %r0 [orig:69 fmt ] [69])
        (nil)))
$2 = void
(gdb) print debug_rtx (tmp)
(jump_insn 133 132 0 /tmp/x.c:9 (addr_diff_vec:HI (label_ref:SI 132)
         [
            (label_ref:SI 15)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 52)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 70)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 36)
            (label_ref:SI 92)
            (label_ref:SI 36)
            (label_ref:SI 110)
        ]
        (const_int 0 [0x0])
        (const_int 0 [0x0])) -1 (nil)
    (nil))
$3 = void


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