]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
com.c (ffecom_convert_narrow_, [...]): Allow conversion from pointer to same-sized...
authorCraig Burley <burley@gnu.org>
Wed, 5 Aug 1998 11:04:19 +0000 (07:04 -0400)
committerDave Love <fx@gcc.gnu.org>
Wed, 5 Aug 1998 11:04:19 +0000 (11:04 +0000)
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

gcc/f/ChangeLog
gcc/f/com.c

index 4da2c4e707cb5557bb65f15ff31d62db62bdb5fb..ed691ba9082df1c098f362dbadb39d3d708169fc 100644 (file)
@@ -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.
index 269477dfc6723fc8335914d22557dc4d1aba0566..fc1f6a5fc7718e23fa866925c4155c87e063fb18 100644 (file)
@@ -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)