diff options
author | Craig Burley <burley@gnu.org> | 1998-08-05 07:04:19 -0400 |
---|---|---|
committer | Dave Love <fx@gcc.gnu.org> | 1998-08-05 11:04:19 +0000 |
commit | 394959aab7e5ebf9f675f7995eda4fbfea566cb3 (patch) | |
tree | 16d1b5d5070aa5871071f2947b7fa1c999d90ba6 /gcc/f | |
parent | 3f2404487bf3cd38d89aec01ec8488e234343814 (diff) | |
download | gcc-394959aab7e5ebf9f675f7995eda4fbfea566cb3.tar.gz |
com.c (ffecom_convert_narrow_, [...]): Allow conversion from pointer to same-sized integer...
Tue Aug 4 16:59:39 1998 Craig Burley <burley@gnu.org>
* com.c (ffecom_convert_narrow_, ffecom_convert_widen_):
Allow conversion from pointer to same-sized integer,
to fix invoking SIGNAL as a function.
From-SVN: r21616
Diffstat (limited to 'gcc/f')
-rw-r--r-- | gcc/f/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/f/com.c | 14 |
2 files changed, 16 insertions, 4 deletions
diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog index 4da2c4e707c..ed691ba9082 100644 --- a/gcc/f/ChangeLog +++ b/gcc/f/ChangeLog @@ -1,3 +1,9 @@ +Tue Aug 4 16:59:39 1998 Craig Burley <burley@gnu.org> + + * 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 <d.love@dl.ac.uk> * 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) |