This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/15286] ICE cause by reload
- From: "fjahanian at apple dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 May 2004 17:06:18 -0000
- Subject: [Bug target/15286] ICE cause by reload
- References: <20040504204950.15286.fjahanian@apple.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From fjahanian at apple dot com 2004-05-05 17:06 -------
Well, I tried lots of things. I have a 'partial' solution for this problem. Bad pattern is produced
in routine gen_reload for the following arguments:
in: (reg:DI 32 f0)
out: (subreg:DI (reg/v:SI 142 [ clock_start ]) 0)
resulting in the generation of bad pattern:
(insn 247 30 32 2 (set (reg/v:SI 142 [ clock_start ])
(subreg:SI (reg:DI 32 f0) 4)) -1 (nil)
(nil))
I fix it by going to memory to move f0 to subreg:DI (reg/v:SI 142 [ clock_start ]) instead:
(insn 248 0 249 (set (mem:DI (plus:SI (reg/f:SI 1 r1)
(const_int 480 [0x1e0])) [0 S8 A8])
(reg:DI 32 f0)) -1 (nil)
(nil))
(insn 249 248 0 (set (subreg:DI (reg/v:SI 142 [ clock_start ]) 0)
(mem:DI (plus:SI (reg/f:SI 1 r1)
(const_int 480 [0x1e0])) [0 S8 A8])) -1 (nil)
(nil))
But there is still a problem. I get an ICE later on because I increased the stack size for the
temporary. I also noticed that a similar code is there in the same routine to do a similar
thing. How can I create a temporary such that later assertion on stack size is not
violated? If this cannot be done, then how come, there is code further down in the same
routine which does exactly that?
Here is the diff for what it is worth (ignore that checks in the if-condition. It can be
sanitized later on).
Index: reload1.c
============================================================
=======
RCS file: /cvs/gcc/gcc/gcc/reload1.c,v
retrieving revision 1.346.2.33
diff -c -p -r1.346.2.33 reload1.c
*** reload1.c 5 Mar 2004 23:48:16 -0000 1.346.2.33
--- reload1.c 5 May 2004 00:33:41 -0000
--- 7344,7350 ----
Returns first insn emitted. */
+
rtx
gen_reload (rtx out, rtx in, int opnum, enum reload_type type)
{
*************** gen_reload (rtx out, rtx in, int opnum,
*** 7357,7362 ****
--- 7358,7374 ----
> GET_MODE_SIZE (GET_MODE (SUBREG_REG (in))))
&& (tem = gen_lowpart_common (GET_MODE (SUBREG_REG (in)), out)) != 0)
in = SUBREG_REG (in), out = tem;
+ else if (GET_CODE (out) == SUBREG
+ && GET_MODE (out) == DImode
+ && GET_CODE (in) == REG
+ && GET_MODE (in) == DImode
+ && FP_REGNO_P (REGNO (in)))
+ {
+ /* Get the memory to use and rewrite both registers to its mode. */
+ rtx loc = get_secondary_mem (in, GET_MODE (out), opnum, type);
+ gen_reload (loc, in, opnum, type);
+ in = loc;
+ }
else if (GET_CODE (out) == SUBREG
&& (GET_MODE_SIZE (GET_MODE (out))
> GET_MODE_SIZE (GET_MODE (SUBREG_REG (out))))
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |uweigand at de dot ibm dot
| |com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15286