2014-03-08 Paulo Matos <paulo@matos-sorge.com>
authorpmatos <pmatos@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 8 Mar 2014 10:54:05 +0000 (10:54 +0000)
committerpmatos <pmatos@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 8 Mar 2014 10:54:05 +0000 (10:54 +0000)
    Richard Biener  <rguenther@suse.de>

* lto-wrapper.c (merge_and_complain): Ensure -fshort-double is used
consistently accross all TUs.
(run_gcc): Enable -fshort-double automatically at link at link-time
and disallow override.

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

    * c.opt: Enable LTO FE for fshort-double.

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

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

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

    * lto-lang.c (lto_init): Pass flag_short_double to
    build_common_tree_nodes.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208428 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c.opt
gcc/lto-wrapper.c
gcc/lto/ChangeLog
gcc/lto/lto-lang.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/lto/pr55113_0.c [new file with mode: 0644]

index 5611246..8988006 100644 (file)
@@ -1,3 +1,11 @@
+2014-03-08  Paulo Matos  <paulo@matos-sorge.com>
+           Richard Biener  <rguenther@suse.de>
+
+       * lto-wrapper.c (merge_and_complain): Ensure -fshort-double is used
+       consistently accross all TUs.
+       (run_gcc): Enable -fshort-double automatically at link at link-time
+       and disallow override.
+
 2014-03-08  Richard Sandiford  <rdsandiford@googlemail.com>
 
        PR target/58271
index 6830fd5..7d49933 100644 (file)
@@ -1,3 +1,7 @@
+2014-03-08  Paulo Matos  <paulo@matos-sorge.com>
+
+    * c.opt: Enable LTO FE for fshort-double.
+
 2014-03-07  Jason Merrill  <jason@redhat.com>
 
        * c.opt: Add -std=c++14.
index 93fb7c2..625c3ba 100644 (file)
@@ -1141,7 +1141,7 @@ C++ ObjC++ Optimization Var(flag_rtti) Init(1)
 Generate run time type descriptor information
 
 fshort-double
-C ObjC C++ ObjC++ Optimization Var(flag_short_double)
+C ObjC C++ ObjC++ LTO Optimization Var(flag_short_double)
 Use the same size for double as for float
 
 fshort-enums
index cf587cb..eb5611b 100644 (file)
@@ -452,6 +452,7 @@ merge_and_complain (struct cl_decoded_option **decoded_options,
 
        case OPT_freg_struct_return:
        case OPT_fpcc_struct_return:
+       case OPT_fshort_double:
          for (j = 0; j < *decoded_options_count; ++j)
            if ((*decoded_options)[j].opt_index == foption->opt_index)
              break;
@@ -677,6 +678,7 @@ run_gcc (unsigned argc, char *argv[])
        case OPT_fgnu_tm:
        case OPT_freg_struct_return:
        case OPT_fpcc_struct_return:
+       case OPT_fshort_double:
        case OPT_ffp_contract_:
        case OPT_fwrapv:
        case OPT_ftrapv:
@@ -748,6 +750,7 @@ run_gcc (unsigned argc, char *argv[])
 
        case OPT_freg_struct_return:
        case OPT_fpcc_struct_return:
+       case OPT_fshort_double:
          /* Ignore these, they are determined by the input files.
             ???  We fail to diagnose a possible mismatch here.  */
          continue;
index 815d0c1..7a2940e 100644 (file)
@@ -1,3 +1,8 @@
+2014-03-08  Paulo Matos  <paulo@matos-sorge.com>
+
+    * lto-lang.c (lto_init): Pass flag_short_double to
+    build_common_tree_nodes.
+
 2014-02-14  Jan Hubicka  <hubicka@ucw.cz>
 
        PR lto/60295
index 28eac6f..f92e884 100644 (file)
@@ -1158,7 +1158,7 @@ lto_init (void)
   flag_generate_lto = (flag_wpa != NULL);
 
   /* Create the basic integer types.  */
-  build_common_tree_nodes (flag_signed_char, /*short_double=*/false);
+  build_common_tree_nodes (flag_signed_char, flag_short_double);
 
   /* The global tree for the main identifier is filled in by
      language-specific front-end initialization that is not run in the
index f29b5a4..318f519 100644 (file)
@@ -1,3 +1,7 @@
+2014-03-08  Paulo Matos  <paulo@matos-sorge.com>
+
+    * gcc.dg/lto/pr55113_0.c: New testcase.
+
 2014-03-08  Adam Butcher  <adam@jessamine.co.uk>
 
        PR c++/60033
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;
+}