tree-streamer.c (record_common_node): Assert we don't record nodes with type double.
authorPaulo Matos <paulo@matos-sorge.com>
Tue, 4 Mar 2014 11:45:06 +0000 (12:45 +0100)
committerPaulo Matos <pmatos@gcc.gnu.org>
Tue, 4 Mar 2014 11:45:06 +0000 (12:45 +0100)
2014-03-04  Paulo Matos  <paulo@matos-sorge.com>

        * tree-streamer.c (record_common_node): Assert we don't record
        nodes with type double.
        (preload_common_node): Skip type double, complex double and
        double pointer since it is now frontend dependent due to
        fshort-double option.

2014-03-04  Paulo Matos  <paulo@matos-sorge.com>

        * gcc.dg/lto/pr55113_0.c: New testcase.

From-SVN: r208312

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/lto/pr55113_0.c [new file with mode: 0644]
gcc/tree-streamer.c

index 2faa849a8fc1bcdda184c7f4908d745d12286875..57bb1d5a711c344aa059f3fa4df833c0df33cc48 100644 (file)
@@ -1,3 +1,11 @@
+2014-03-04  Paulo Matos  <paulo@matos-sorge.com>
+
+        * tree-streamer.c (record_common_node): Assert we don't record
+        nodes with type double.
+        (preload_common_node): Skip type double, complex double and
+        double pointer since it is now frontend dependent due to
+        fshort-double option.
+
 2014-03-04  Richard Biener  <rguenther@suse.de>
 
        PR lto/60405
index 3a683dbea4583de202c38d04f82aaef6cd4c0374..3d8b5459ada50c276c467beeda14045e77052ecc 100644 (file)
@@ -1,3 +1,7 @@
+2014-03-04  Paulo Matos  <paulo@matos-sorge.com>
+
+        * gcc.dg/lto/pr55113_0.c: New testcase.
+
 2014-03-04  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/60376
diff --git a/gcc/testsuite/gcc.dg/lto/pr55113_0.c b/gcc/testsuite/gcc.dg/lto/pr55113_0.c
new file mode 100644 (file)
index 0000000..8ef11dc
--- /dev/null
@@ -0,0 +1,13 @@
+/* PR 55113 */
+/* { dg-lto-do link } */
+/* { dg-lto-options { { -flto -fshort-double -O0 } } }*/
+/* { dg-skip-if "PR60410" { { x86_64-*-* i?86-*-* } && lp64 } } */
+
+int 
+main(void)
+{
+  float a = 1.0;
+  float b = 2.0;
+  double f = a + b * 1e-12;
+  return (int)f - 1;
+}
index af9461e77106cf034708952dd7e5bdedc79128e7..4b3e3e4cd5a00013e8b7200b66bbf57560e659a2 100644 (file)
@@ -264,7 +264,8 @@ record_common_node (struct streamer_tree_cache_d *cache, tree node)
 
   gcc_checking_assert (node != boolean_type_node
                       && node != boolean_true_node
-                      && node != boolean_false_node);
+                      && node != boolean_false_node
+                      && node != double_type_node);
 
   /* We have to make sure to fill exactly the same number of
      elements for all frontends.  That can include NULL trees.
@@ -315,10 +316,14 @@ preload_common_nodes (struct streamer_tree_cache_d *cache)
     record_common_node (cache, sizetype_tab[i]);
 
   for (i = 0; i < TI_MAX; i++)
-    /* Skip boolean type and constants, they are frontend dependent.  */
+    /* Skip boolean type and constants. They are frontend dependent.
+       Skip double type, frontend dependent due to -fshort-double.  */
     if (i != TI_BOOLEAN_TYPE
        && i != TI_BOOLEAN_FALSE
-       && i != TI_BOOLEAN_TRUE)
+       && i != TI_BOOLEAN_TRUE
+       && i != TI_DOUBLE_TYPE
+       && i != TI_COMPLEX_DOUBLE_TYPE
+       && i != TI_DOUBLE_PTR_TYPE)
       record_common_node (cache, global_trees[i]);
 }