This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
set_label_offset fix
- To: gcc-patches at gcc dot gnu dot org, rth at cygnus dot com
- Subject: set_label_offset fix
- From: Jan Hubicka <jh at suse dot cz>
- Date: Mon, 31 Jul 2000 00:54:58 +0200
Hi
The elimination code fails to handle jump insns in parallels and confuses
the elimination offsets. For example following code:
int exit(int) __attribute__ ((noreturn));
int q;
t(volatile int a)
{
printf("%i\n",a-1);
if (q<0.)
exit(1);
printf("%i\n",a-1);
}
main()
{
t(0);
}
Prints two different values with -O2 -fomit-frame-pointer, since reload1 confuses
the elimination offsets around the floating point jump.
Proper way is of course to use CFG, but since it is inconsistent, we will have
to live with this fix IMO.
Honza
Mon Jul 31 00:23:29 CEST 2000 Jan Hubicka <jh@suse.cz>
* reload1.c (set_label_offsets): Handle JUMP_INSN in parallels.
*** reload1.c.mm Mon Jul 31 00:17:38 2000
--- reload1.c Mon Jul 31 00:30:01 2000
*************** set_label_offsets (x, insn, initial_p)
*** 2079,2085 ****
return;
case JUMP_INSN:
! set_label_offsets (PATTERN (insn), insn, initial_p);
/* ... fall through ... */
--- 2079,2096 ----
return;
case JUMP_INSN:
! {
! /* We need track labels inside jumps. Also we may hit ADDR_VEC
! expression here. */
! rtx x = pc_set (insn);
! if (!x)
! {
! if (GET_CODE (PATTERN (insn)) != ADDR_VEC)
! abort();
! x = PATTERN (insn);
! }
! set_label_offsets (x, insn, initial_p);
! }
/* ... fall through ... */