This is the mail archive of the gcc-patches@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]

Re: RFA: another simd bug fix (Was: Re: RFA: improved generic simd operations)


On Tue, 09 Jul 2002, Joern Rennecke wrote:

> We can get the mode from dest as well.
> Also note that byte number 0 is incorrect, as I mentioned earlier.
> I have appended an updated patch.
> 	
No.  This is the same fix that you sent last week and fails in
the same way.

The problem is not related to the byte number nor the mode of
'dest'.  It's the mode of elt->exp what's causing
simplify_gen_subreg to return NULL_RTX.

You will be able to reproduce the same bug with the test case I
sent in my previous message.  Below are excerpts from a debugging
session that shows how the bug is triggered:

-----------------------------------------------------------------------------

$ gdb ./cc1
(gdb) run -O2 20020709-1.c
Program received signal SIGSEGV, Segmentation fault.
0x080c66c0 in cse_insn (insn=0x401acb40, libcall_insn=0x0)
    at /home/dnovillo/perf/toribio/spec95/gcc/src/gcc/cse.c:6215
6215                    src_hash = HASH (new_src, new_mode);
(gdb) list 6215
6210                      byte = (GET_MODE_SIZE (GET_MODE (dest))
6211                              - GET_MODE_SIZE (new_mode));
6212                    new_src = simplify_gen_subreg (new_mode, elt->exp,
6213                                                   GET_MODE (dest), byte);
6214
6215                    src_hash = HASH (new_src, new_mode);
6216                    src_elt = lookup (new_src, src_hash, new_mode);
6217
6218                    /* Put the new source in the hash table is if isn't
6219                       already.  */
(gdb) b 6212
Breakpoint 1 at 0x80c6694: file /home/dnovillo/perf/toribio/spec95/gcc/src/gcc/cse.c, line 6212.
(gdb) ignore 1 3
Will ignore next 3 crossings of breakpoint 1.
(gdb) run
Breakpoint 1, cse_insn (insn=0x401acb40, libcall_insn=0x0)
    at /home/dnovillo/perf/toribio/spec95/gcc/src/gcc/cse.c:6212
6212                    new_src = simplify_gen_subreg (new_mode, elt->exp,
(gdb) print new_mode
$2 = DImode
(gdb) pr elt->exp
(expr_list (use (mem:BLK (scratch) [0 A8]))
    (expr_list (symbol_ref:SI ("atof"))
        (expr_list (reg/v/f:SI 58)
            (nil))))
void(gdb) pr dest
(subreg:DF (reg/v:DI 59) 0)
void(gdb) print byte
$3 = 0
(gdb) s
simplify_gen_subreg (outermode=DImode, op=0x40194fa0, innermode=DFmode, byte=0)
    at /home/dnovillo/perf/toribio/spec95/gcc/src/gcc/simplify-rtx.c:2596
2596      if (innermode == VOIDmode || outermode == VOIDmode
(gdb) s
2600      if (GET_MODE (op) != innermode
(gdb) s
2604      if (byte % GET_MODE_SIZE (outermode)
(gdb) s
2608      if (GET_CODE (op) == QUEUED)
(gdb) s
2611      new = simplify_subreg (outermode, op, innermode, byte);
(gdb) n
2612      if (new)
(gdb) print new
$4 = 0x0
(gdb) s
2615      if (GET_CODE (op) == SUBREG || GET_MODE (op) == VOIDmode)
(gdb) pr op
(expr_list (use (mem:BLK (scratch) [0 A8]))
    (expr_list (symbol_ref:SI ("atof"))
        (expr_list (reg/v/f:SI 58)
            (nil))))
void(gdb) get_mode op
VOIDmode(gdb) s
2616        return NULL_RTX;
(gdb) s
2619    }
(gdb) s
cse_insn (insn=0x401acb40, libcall_insn=0x0)
    at /home/dnovillo/perf/toribio/spec95/gcc/src/gcc/cse.c:6215
6215                    src_hash = HASH (new_src, new_mode);
(gdb) s

Program received signal SIGSEGV, Segmentation fault.
0x080c66c0 in cse_insn (insn=0x401acb40, libcall_insn=0x0)
    at /home/dnovillo/perf/toribio/spec95/gcc/src/gcc/cse.c:6215
6215                    src_hash = HASH (new_src, new_mode);
(gdb)


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