From: Craig Burley Date: Wed, 5 Aug 1998 11:19:05 +0000 (-0400) Subject: com.c (ffecom_convert_narrow_, [...]): Allow conversion from pointer to same-sized... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a74de6ea6859b83927debfd99a95bf9fbc74b657;p=gcc.git com.c (ffecom_convert_narrow_, [...]): Allow conversion from pointer to same-sized integer... Tue Aug 4 16:59:39 1998 Craig Burley * com.c (ffecom_convert_narrow_, ffecom_convert_widen_): Allow conversion from pointer to same-sized integer, to fix invoking SIGNAL as a function. [[Split portion of a mixed commit.]] From-SVN: r21617.2 --- diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog index 806841a40b3..d9fd6ef1218 100644 --- a/gcc/f/ChangeLog +++ b/gcc/f/ChangeLog @@ -1,3 +1,9 @@ +Tue Aug 4 16:59:39 1998 Craig Burley + + * com.c (ffecom_convert_narrow_, ffecom_convert_widen_): + Allow conversion from pointer to same-sized integer, + to fix invoking SIGNAL as a function. + 1998-07-26 Dave Love * BUGS, INSTALL, NEWS: Rebuilt. diff --git a/gcc/f/com.c b/gcc/f/com.c index 269477dfc67..fc1f6a5fc77 100644 --- a/gcc/f/com.c +++ b/gcc/f/com.c @@ -922,8 +922,11 @@ ffecom_convert_narrow_ (type, expr) assert (code != ENUMERAL_TYPE); if (code == INTEGER_TYPE) { - assert (TREE_CODE (TREE_TYPE (e)) == INTEGER_TYPE); - assert (TYPE_PRECISION (type) <= TYPE_PRECISION (TREE_TYPE (e))); + assert ((TREE_CODE (TREE_TYPE (e)) == INTEGER_TYPE + && TYPE_PRECISION (type) <= TYPE_PRECISION (TREE_TYPE (e))) + || (TREE_CODE (TREE_TYPE (e)) == POINTER_TYPE + && (TYPE_PRECISION (type) + == TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (e)))))); return fold (convert_to_integer (type, e)); } if (code == POINTER_TYPE) @@ -992,8 +995,11 @@ ffecom_convert_widen_ (type, expr) assert (code != ENUMERAL_TYPE); if (code == INTEGER_TYPE) { - assert (TREE_CODE (TREE_TYPE (e)) == INTEGER_TYPE); - assert (TYPE_PRECISION (type) >= TYPE_PRECISION (TREE_TYPE (e))); + assert ((TREE_CODE (TREE_TYPE (e)) == INTEGER_TYPE + && TYPE_PRECISION (type) >= TYPE_PRECISION (TREE_TYPE (e))) + || (TREE_CODE (TREE_TYPE (e)) == POINTER_TYPE + && (TYPE_PRECISION (type) + == TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (e)))))); return fold (convert_to_integer (type, e)); } if (code == POINTER_TYPE)