This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
problem with generating epilogue
- To: gcc at gcc dot gnu dot org
- Subject: problem with generating epilogue
- From: Herman ten Brugge <Haj dot Ten dot Brugge at net dot HCC dot nl>
- Date: Thu, 3 Aug 2000 18:49:05 +0100 (WEST)
Hello,
Last week I implemented prologue/epilogue rtl code for the c4x. I had
some problems with a jump insn at the end of the epilogue. I fixed this
by using emit_insn instead of emit_indirect_jump. I forgot all about
this until yesterday. I looked at the implementation of the i386 and
found the same construction there. I can also get this code to fail
with the following code:
typedef struct { int a[100000]; } q;
tst(q a)
{
}
If you compile this on a i386 with '-O -mrtd' you should see the
following error (I know -mrtd should not be used but I only want
to explain my problem):
fail.c: In function `tst':
fail.c:4: In basic block 0:
fail.c:4: Flow control insn inside a basic block
(jump_insn 21 20 22 (set (pc)
(reg:SI 2 ecx)) -1 (insn_list 18 (nil))
(expr_list:REG_DEAD (reg:SI 2 ecx)
(nil)))
fail.c:4: Internal compiler error in verify_flow_info, at flow.c:6574
Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
If I apply the same patch as I did on the c4x (dont do this on the i386
cvs tree):
--- i386.c.org Thu Aug 3 18:05:16 2000
+++ i386.c Thu Aug 3 18:08:15 2000
@@ -2138,7 +2138,7 @@ ix86_expand_epilogue (emit_return)
emit_insn (gen_popsi1 (ecx));
emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, popc));
- emit_indirect_jump (ecx);
+ emit_insn (gen_indirect_jump (ecx));
}
else
emit_jump_insn (gen_return_pop_internal (popc));
the problem goes away.
I think there is a problem in flow.c. I do not have time to see how flow
works internally. Could some one have a look at this problem? Why has
some one else not found this problem? Am I the only one that is using
a jump in the epilogue (except from some unused code in i386.c)?
Thanks,
Herman.