This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: another simd bug fix (Was: Re: RFA: improved generic simd operations)
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Joern Rennecke <joern dot rennecke at superh dot com>
- Cc: Falk Hueffner <falk dot hueffner at student dot uni-tuebingen dot de>, Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 9 Jul 2002 13:16:51 -0400
- Subject: Re: RFA: another simd bug fix (Was: Re: RFA: improved generic simd operations)
- Organization: Red Hat Canada
- References: <3D16E422.ECBACCB9@superh.com> <3D1A4A4D.70828E1B@superh.com> <m2fzz9imq5.fsf@culebra.cygnus.com> <3D1B1E4C.6D16F6F6@superh.com> <3D1B5017.7D1FA5@superh.com> <3D22063E.70DB750B@superh.com> <87r8ilbt6e.fsf@student.uni-tuebingen.de> <3D22F082.B3DFAB35@superh.com> <20020709163203.GA5639@tornado.toronto.redhat.com> <3D2B1493.496D8137@superh.com>
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)