http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48908
Summary: [4.7 Regression]: build fails on cris-elf in libiberty:md5.c, shift-related Product: gcc Version: 4.7.0 Status: UNCONFIRMED Keywords: build, ice-on-valid-code Severity: normal Priority: P3 Component: middle-end AssignedTo: unassig...@gcc.gnu.org ReportedBy: h...@gcc.gnu.org CC: rgue...@gcc.gnu.org Host: x86_64-unknown-linux-gnu Target: cris-axis-elf Created attachment 24198 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24198 "cc1 -fpreprocessed md5.i -O2 -o md5.s" to repeat A patch in the revision range (last_known_working:first_known_failing) 173419:173428 caused the build for cris-elf to fail as follows: /tmp/hpautotest-gcc1/cris-elf/gccobj/./gcc/xgcc -B/tmp/hpautotest-gcc1/cris-elf/gccobj/./gcc/ -nostdinc -B/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/newlib/ -isystem /tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/newlib/targ-include -isystem /tmp/hpautotest-gcc1/gcc/newlib/libc/include -B/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libgloss/cris -L/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libgloss/libnosys -L/tmp/hpautotest-gcc1/gcc/libgloss/cris -B/tmp/hpautotest-gcc1/cris-elf/pre/cris-elf/bin/ -B/tmp/hpautotest-gcc1/cris-elf/pre/cris-elf/lib/ -isystem /tmp/hpautotest-gcc1/cris-elf/pre/cris-elf/include -isystem /tmp/hpautotest-gcc1/cris-elf/pre/cris-elf/sys-include -c -DHAVE_CONFIG_H -g -O2 -I. -I/tmp/hpautotest-gcc1/gcc/libiberty/../include -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic /tmp/hpautotest-gcc1/gcc/libiberty/md5.c -o md5.o /tmp/hpautotest-gcc1/gcc/libiberty/md5.c: In function 'md5_finish_ctx': /tmp/hpautotest-gcc1/gcc/libiberty/md5.c:113:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] /tmp/hpautotest-gcc1/gcc/libiberty/md5.c:114:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] /tmp/hpautotest-gcc1/gcc/libiberty/md5.c: In function 'md5_process_block': /tmp/hpautotest-gcc1/gcc/libiberty/md5.c:327:7: internal compiler error: Segmentation fault A gdb backtrace points at revision 173428: (The revision below was 173446) (gdb) r -fpreprocessed /n/slask/hp_tmp/md5.i -O2 -o md5.s Starting program: /tmp/hpautotest-gcc1/cris-elf/gccobj/gcc/cc1 -fpreprocessed /n/slask/hp_tmp/md5.i -O2 -o md5.s md5_process_block Analyzing compilation unit Performing interprocedural optimizations <*free_lang_data> <visibility> <early_local_cleanups> <emutls> <whole-program> <ipa-profile> <cp> <inline> <pure-const> <static-var>Assembling functions: md5_process_block Program received signal SIGSEGV, Segmentation fault. 0x00000000006c3595 in copy_to_mode_reg (mode=SImode, x=0x0) at /tmp/hpautotest-gcc1/gcc/gcc/explow.c:635 635 gcc_assert (GET_MODE (x) == mode || GET_MODE (x) == VOIDmode); Missing separate debuginfos, use: debuginfo-install glibc-2.11.1-1.x86_64 (gdb) p x $1 = (rtx) 0x0 (gdb) bt #0 0x00000000006c3595 in copy_to_mode_reg (mode=SImode, x=0x0) at /tmp/hpautotest-gcc1/gcc/gcc/explow.c:635 #1 0x0000000000929f18 in maybe_legitimize_operand (icode=CODE_FOR_lshrsi3, opno=2, op=0x7fffffffcb60) at /tmp/hpautotest-gcc1/gcc/gcc/optabs.c:7077 #2 0x000000000092a227 in maybe_legitimize_operands (icode=CODE_FOR_lshrsi3, opno=0, nops=3, ops=0x7fffffffcb40) at /tmp/hpautotest-gcc1/gcc/gcc/optabs.c:7139 #3 0x000000000092a2b1 in maybe_gen_insn (icode=CODE_FOR_lshrsi3, nops=3, ops=0x7fffffffcb40) at /tmp/hpautotest-gcc1/gcc/gcc/optabs.c:7157 #4 0x000000000091b792 in expand_binop_directly (mode=SImode, binoptab=0x13b7cb8, op0=0x7ffff7cb3ce0, op1=0x7ffff7eb1e10, target=0x7ffff7cb3d00, unsignedp=1, methods=OPTAB_DIRECT, last=0x7ffff7e0eee8) at /tmp/hpautotest-gcc1/gcc/gcc/optabs.c:1328 #5 0x000000000091b9c2 in expand_binop (mode=SImode, binoptab=0x13b7cb8, op0=0x7ffff7cb3ce0, op1=0x7ffff7eb1e10, target=0x7ffff7cb3d00, unsignedp=1, methods=OPTAB_DIRECT) at /tmp/hpautotest-gcc1/gcc/gcc/optabs.c:1394 #6 0x00000000006ca8f0 in expand_shift_1 (code=RSHIFT_EXPR, mode=SImode, shifted=0x7ffff7cb3ce0, amount=0x7ffff7eb1e10, target=0x7ffff7cb3d00, unsignedp=1) at /tmp/hpautotest-gcc1/gcc/gcc/expmed.c:2166 #7 0x00000000006ca80f in expand_shift_1 (code=LROTATE_EXPR, mode=SImode, shifted=0x7ffff7cb3ce0, amount=0x7ffff7eca4e0, target=0x7ffff7cb3d00, unsignedp=1) at /tmp/hpautotest-gcc1/gcc/gcc/expmed.c:2154 #8 0x00000000006caa77 in expand_variable_shift (code=LROTATE_EXPR, mode=SImode, shifted=0x7ffff7cb3ce0, amount=0x7ffff7f95640, target=0x7ffff7cb3d00, unsignedp=1) at /tmp/hpautotest-gcc1/gcc/gcc/expmed.c:2226 #9 0x00000000006fb2c7 in expand_expr_real_2 (ops=0x7fffffffd860, target=0x7ffff7cb3d00, tmode=SImode, modifier=EXPAND_NORMAL) at /tmp/hpautotest-gcc1/gcc/gcc/expr.c:8062 #10 0x00000000005ec099 in expand_gimple_stmt_1 (stmt=0x7ffff7fbf5d8) at /tmp/hpautotest-gcc1/gcc/gcc/cfgexpand.c:1989 #11 0x00000000005ec301 in expand_gimple_stmt (stmt=0x7ffff7fbf5d8) at /tmp/hpautotest-gcc1/gcc/gcc/cfgexpand.c:2050 #12 0x00000000005f51ad in expand_gimple_basic_block (bb=0x7ffff7f93a28) at /tmp/hpautotest-gcc1/gcc/gcc/cfgexpand.c:3619 #13 0x00000000005f6ee0 in gimple_expand_cfg () at /tmp/hpautotest-gcc1/gcc/gcc/cfgexpand.c:4102 #14 0x000000000093c717 in execute_one_pass (pass=0x138e8e0) at /tmp/hpautotest-gcc1/gcc/gcc/passes.c:1556 #15 0x000000000093c906 in execute_pass_list (pass=0x138e8e0) at /tmp/hpautotest-gcc1/gcc/gcc/passes.c:1611 #16 0x0000000000ab11c8 in tree_rest_of_compilation (fndecl=0x7ffff7f97500) at /tmp/hpautotest-gcc1/gcc/gcc/tree-optimize.c:417 #17 0x0000000000d3e6cf in cgraph_expand_function (node=0x7ffff7fc0000) at /tmp/hpautotest-gcc1/gcc/gcc/cgraphunit.c:1579 #18 0x0000000000d3e88e in cgraph_expand_all_functions () at /tmp/hpautotest-gcc1/gcc/gcc/cgraphunit.c:1638 #19 0x0000000000d3ef1b in cgraph_optimize () at /tmp/hpautotest-gcc1/gcc/gcc/cgraphunit.c:1901 #20 0x0000000000d3c2c5 in cgraph_finalize_compilation_unit () at /tmp/hpautotest-gcc1/gcc/gcc/cgraphunit.c:1099 #21 0x000000000049240d in c_write_global_declarations () at /tmp/hpautotest-gcc1/gcc/gcc/c-decl.c:9846 #22 0x0000000000a1404c in compile_file () at /tmp/hpautotest-gcc1/gcc/gcc/toplev.c:586 #23 0x0000000000a161a8 in do_compile () at /tmp/hpautotest-gcc1/gcc/gcc/toplev.c:1928 #24 0x0000000000a16315 in toplev_main (argc=6, argv=0x7fffffffe128) at /tmp/hpautotest-gcc1/gcc/gcc/toplev.c:2000 #25 0x0000000000556460 in main (argc=6, argv=0x7fffffffe128) at /tmp/hpautotest-gcc1/gcc/gcc/main.c:36 (gdb) up #1 0x0000000000929f18 in maybe_legitimize_operand (icode=CODE_FOR_lshrsi3, opno=2, op=0x7fffffffcb60) at /tmp/hpautotest-gcc1/gcc/gcc/optabs.c:7077 7077 op->value = copy_to_mode_reg (mode, op->value); (gdb) p *op $1 = {type = EXPAND_INPUT, unsigned_p = 0, unused = 0, mode = SImode, value = 0x7ffff7eb1e10} (gdb) p op->value $2 = (rtx) 0x7ffff7eb1e10 (gdb) pr (minus (const_int 32 [0x20]) (const_int 7 [0x7])) (gdb) Author of the most suspect patch in revision range CC:ed. See also the preprocessed test-case.