]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
stor-layout.c (layout_type): Move setting complex MODE to layout_type...
authorMichael Meissner <meissner@linux.vnet.ibm.com>
Tue, 21 Jun 2016 20:57:20 +0000 (20:57 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Tue, 21 Jun 2016 20:57:20 +0000 (20:57 +0000)
[gcc]
2016-06-21  Michael Meissner  <meissner@linux.vnet.ibm.com>

* stor-layout.c (layout_type): Move setting complex MODE to
layout_type, instead of setting it ahead of time by the caller.
* tree.c (build_complex_type): Likewise.

[gcc/fortran]
2016-06-21  Michael Meissner  <meissner@linux.vnet.ibm.com>

* trans-types.c (gfc_build_complex_type): Move setting complex
MODE to layout_type, instead of setting it ahead of time by the
caller.

From-SVN: r237657

gcc/ChangeLog
gcc/fortran/ChangeLog
gcc/fortran/trans-types.c
gcc/stor-layout.c
gcc/tree.c

index 06179d1f748343ea033bfd944a7dc352c62b9838..627de2bfdcb84237bf354d69e61bda376f7700e7 100644 (file)
@@ -1,3 +1,9 @@
+2016-06-21  Michael Meissner  <meissner@linux.vnet.ibm.com>
+
+       * stor-layout.c (layout_type): Move setting complex MODE to
+       layout_type, instead of setting it ahead of time by the caller.
+       * tree.c (build_complex_type): Likewise.
+
 2016-06-21  Martin Liska  <mliska@suse.cz>
 
        * predict.c (force_edge_cold): Replace imposisble with
index 317fee5b6be94516e89ca6ebe266f6a5e4fbb581..9b4b957b1096a900ff26e52f58fbfcf6bf99341b 100644 (file)
@@ -1,3 +1,9 @@
+2016-06-21  Michael Meissner  <meissner@linux.vnet.ibm.com>
+
+       * trans-types.c (gfc_build_complex_type): Move setting complex
+       MODE to layout_type, instead of setting it ahead of time by the
+       caller.
+
 2016-06-21  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/71068
index 0f4172522f1bf8ed74a9557643c45f99252dfb62..bde64f499c7e6c4ba182b7b9da7c7b5d7f9cb945 100644 (file)
@@ -828,7 +828,6 @@ gfc_build_complex_type (tree scalar_type)
 
   new_type = make_node (COMPLEX_TYPE);
   TREE_TYPE (new_type) = scalar_type;
-  SET_TYPE_MODE (new_type, GET_MODE_COMPLEX_MODE (TYPE_MODE (scalar_type)));
   layout_type (new_type);
   return new_type;
 }
index bf8a978c06247ab176f805965b127e78a6d6c03f..40170efb33f736677d5409d060baef7159decfc6 100644 (file)
@@ -2146,12 +2146,8 @@ layout_type (tree type)
 
     case COMPLEX_TYPE:
       TYPE_UNSIGNED (type) = TYPE_UNSIGNED (TREE_TYPE (type));
-
-      /* build_complex_type and fortran's gfc_build_complex_type have set the
-        expected mode to allow having multiple complex types for multiple
-        floating point types that have the same size such as the PowerPC with
-        __ibm128 and __float128.  */
-      gcc_assert (TYPE_MODE (type) != VOIDmode);
+      SET_TYPE_MODE (type,
+                    GET_MODE_COMPLEX_MODE (TYPE_MODE (TREE_TYPE (type))));
 
       TYPE_SIZE (type) = bitsize_int (GET_MODE_BITSIZE (TYPE_MODE (type)));
       TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (TYPE_MODE (type)));
index fd0e6921bfd754c0cf9e6bd01f39b432166a6dfa..58c663a8220173f70fc3f82ed5e4b63de337f679 100644 (file)
@@ -8783,7 +8783,6 @@ build_complex_type (tree component_type)
   t = make_node (COMPLEX_TYPE);
 
   TREE_TYPE (t) = TYPE_MAIN_VARIANT (component_type);
-  SET_TYPE_MODE (t, GET_MODE_COMPLEX_MODE (TYPE_MODE (component_type)));
 
   /* If we already have such a type, use the old one.  */
   hstate.add_object (TYPE_HASH (component_type));