This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch to fix rtx_unstable_p & rtx_varies_p volatile asm handling
- To: gcc-patches at gcc dot gnu dot org
- Subject: Patch to fix rtx_unstable_p & rtx_varies_p volatile asm handling
- From: John Wehle <john at feith dot com>
- Date: Fri, 15 Sep 2000 17:49:08 -0400 (EDT)
Volatile asms are unstable and can vary. This patch passes make bootstrap
and make check on Compaq Tru64 UNIX 4.0f and FreeBSD-3.5 x86.
ChangeLog:
Fri Sep 15 01:37:10 EDT 2000 John Wehle (john@feith.com)
* rtlanal.c (rtx_varies_p): Volatile asms vary.
(rtx_unstable_p): Restructure code. Volatile asms
are unstable.
Enjoy!
-- John Wehle
------------------8<------------------------8<------------------------
*** gcc/rtlanal.c.ORIGINAL Tue Aug 22 23:49:55 2000
--- gcc/rtlanal.c Fri Sep 15 01:34:47 2000
*************** rtx_unstable_p (x)
*** 52,71 ****
register int i;
register const char *fmt;
! if (code == MEM)
! return ! RTX_UNCHANGING_P (x) || rtx_unstable_p (XEXP (x, 0));
! if (code == QUEUED)
! return 1;
! if (CONSTANT_P (x))
! return 0;
! if (code == REG)
! /* As in rtx_varies_p, we have to use the actual rtx, not reg number. */
! return ! (x == frame_pointer_rtx || x == hard_frame_pointer_rtx
! || x == arg_pointer_rtx || x == pic_offset_table_rtx
! || RTX_UNCHANGING_P (x));
fmt = GET_RTX_FORMAT (code);
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
--- 52,87 ----
register int i;
register const char *fmt;
! switch (code)
! {
! case MEM:
! return ! RTX_UNCHANGING_P (x) || rtx_unstable_p (XEXP (x, 0));
!
! case QUEUED:
! return 1;
! case CONST:
! case CONST_INT:
! case CONST_DOUBLE:
! case SYMBOL_REF:
! case LABEL_REF:
! return 0;
! case REG:
! /* As in rtx_varies_p, we have to use the actual rtx, not reg number. */
! return ! (x == frame_pointer_rtx || x == hard_frame_pointer_rtx
! || x == arg_pointer_rtx || x == pic_offset_table_rtx
! || RTX_UNCHANGING_P (x));
! case ASM_OPERANDS:
! if (MEM_VOLATILE_P (x))
! return 1;
!
! /* FALLTHROUGH */
!
! default:
! break;
! }
fmt = GET_RTX_FORMAT (code);
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
*************** rtx_varies_p (x)
*** 126,131 ****
--- 142,153 ----
(in fact is it related specifically to operand 1). */
return rtx_varies_p (XEXP (x, 1));
+ case ASM_OPERANDS:
+ if (MEM_VOLATILE_P (x))
+ return 1;
+
+ /* FALLTHROUGH */
+
default:
break;
}
-------------------------------------------------------------------------
| Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com |
| John Wehle | Fax: 1-215-540-5495 | |
-------------------------------------------------------------------------