This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Some help with fold_convert() on RECORD_TYPEs


>  Yeah, it should return false for some classes of types, RECORD_TYPE, UNION_TYPE,
>  ARRAY_TYPE come to my mind here.  Patch welcome ;)

I'd suggest:

Index: fold-const.c
===================================================================
--- fold-const.c        (revision 131974)
+++ fold-const.c        (working copy)
@@ -2476,8 +2476,15 @@ fold_convertible_p (const_tree type, con
       return (TREE_CODE (orig) == VECTOR_TYPE
              && tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (orig)));

-    default:
+    case REAL_TYPE:
+    case FIXED_POINT_TYPE:
+    case COMPLEX_TYPE:
+    case VECTOR_TYPE:
+    case VOID_TYPE:
       return TREE_CODE (type) == TREE_CODE (orig);
+
+    default:
+      return false;
     }
 }




-- 
FX Coudert
http://www.homepages.ucl.ac.uk/~uccafco/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]