On 06/03/14 11:19, Richard Biener wrote:
On Wed, Mar 5, 2014 at 12:55 PM, Paulo Matos <pa...@matos-sorge.com> wrote:
On 05/03/2014 11:51, Richard Biener wrote:

On Wed, Mar 5, 2014 at 12:43 PM, Dominique Dhumieres <domi...@lps.ens.fr>
wrote:


Revision 208312 causes

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60427


Uhm.  pointer comparison against double_type_node ...

I'd say we want to revert the patch.  Paulo, please do that.  Let's
do the alternate approach of marking -fshort-double eligible for LTO
as well and handle it there properly.


Sure, I will prepare a new patch and post it for approval by the end of the
day.

Apologies for the regression.

I have reverted the patch for now.

Richard.



Please find new patch attached. I have enabled LTO for short-double and passed flag_short_double to build_common_tree_nodes.

I have tested this for C on powerpc-eabipse (target for which we are fixing pr55113), and C/Fortran on a x86_64. Saw no regressions.

OK to commit?

gcc/c-family/
2014-03-06  Paulo Matos  <pa...@matos-sorge.com>

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

gcc/lto/
2014-03-06  Paulo Matos  <pa...@matos-sorge.com>

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

gcc/testsuite/
2014-03-06  Paulo Matos  <pa...@matos-sorge.com>

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


--
Paulo Matos
Index: gcc/c-family/c.opt
===================================================================
--- gcc/c-family/c.opt	(revision 208385)
+++ gcc/c-family/c.opt	(working copy)
@@ -1141,7 +1141,7 @@ C++ ObjC++ Optimization Var(flag_rtti) I
 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: gcc/lto/lto-lang.c
===================================================================
--- gcc/lto/lto-lang.c	(revision 208385)
+++ gcc/lto/lto-lang.c	(working copy)
@@ -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: gcc/testsuite/gcc.dg/lto/pr55113_0.c
===================================================================
--- gcc/testsuite/gcc.dg/lto/pr55113_0.c	(revision 0)
+++ gcc/testsuite/gcc.dg/lto/pr55113_0.c	(working copy)
@@ -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;
+}

Reply via email to