[PATCH 1/2] Remove -fshort-double

Richard Biener richard.guenther@gmail.com
Mon Sep 29 11:17:00 GMT 2014


On Sat, Sep 27, 2014 at 3:54 PM, Andi Kleen <andi@firstfloor.org> wrote:
> From: Andi Kleen <ak@linux.intel.com>
>
> -fshort-double has crashes the compiler since 4.6 (see PR60410)
> Since it's an obscure option that apparently nobody uses it the
> best way to fix it seems to just remove it.
>
> This prevents constant ICEs when running an gcc optimization flags
> autotuner.

As we saw LTO fixes for -fshort-double it's clear that this flag _is_ used
for some embedded archs.

So - no, you can't simply remove it.  But IMHO it should become a
target-specific flag.

Richard.

> gcc/testsuite/:
>
> 2014-09-26  Andi Kleen  <ak@linux.intel.com>
>
>         PR target/60410
>         * gcc.dg/lto/pr55113_0.c: Remove.
>
> gcc/:
>
> 2014-09-26  Andi Kleen  <ak@linux.intel.com>
>
>         PR target/60410
>         * doc/invoke.texi: Remove -fshort-double.
>         * lto-wrapper.c (merge_and_complain): Dito.
>         (run_gcc): Dito.
>
> gcc/c-family/:
>
> 2014-09-26  Andi Kleen  <ak@linux.intel.com>
>
>         PR target/60410
>         * c-common.c (c_common_nodes_and_builtins): Remove
>         -fshort-double.
>         * c.opt: Dito.
>
> gcc/lto/:
>
> 2014-09-26  Andi Kleen  <ak@linux.intel.com>
>
>         PR target/60410
>         * lto-lang.c (lto_init): Remove -fshort-double.
> ---
>  gcc/c-family/c-common.c              |  2 +-
>  gcc/c-family/c.opt                   |  4 ----
>  gcc/doc/invoke.texi                  | 10 +---------
>  gcc/lto-wrapper.c                    |  3 ---
>  gcc/lto/lto-lang.c                   |  2 +-
>  gcc/testsuite/gcc.dg/lto/pr55113_0.c | 14 --------------
>  6 files changed, 3 insertions(+), 32 deletions(-)
>  delete mode 100644 gcc/testsuite/gcc.dg/lto/pr55113_0.c
>
> diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
> index a9e0191..7a529a2 100644
> --- a/gcc/c-family/c-common.c
> +++ b/gcc/c-family/c-common.c
> @@ -5325,7 +5325,7 @@ c_common_nodes_and_builtins (void)
>    tree va_list_ref_type_node;
>    tree va_list_arg_type_node;
>
> -  build_common_tree_nodes (flag_signed_char, flag_short_double);
> +  build_common_tree_nodes (flag_signed_char, false);
>
>    /* Define `int' and `char' first so that dbx will output them first.  */
>    record_builtin_type (RID_INT, NULL, integer_type_node);
> diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
> index 72ac2ed..d6a9698 100644
> --- a/gcc/c-family/c.opt
> +++ b/gcc/c-family/c.opt
> @@ -1251,10 +1251,6 @@ frtti
>  C++ ObjC++ Optimization Var(flag_rtti) Init(1)
>  Generate run time type descriptor information
>
> -fshort-double
> -C ObjC C++ ObjC++ LTO Optimization Var(flag_short_double)
> -Use the same size for double as for float
> -
>  fshort-enums
>  C ObjC C++ ObjC++ LTO Optimization Var(flag_short_enums)
>  Use the narrowest integer type possible for enumeration types
> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
> index 0c3f4be..b2b667d 100644
> --- a/gcc/doc/invoke.texi
> +++ b/gcc/doc/invoke.texi
> @@ -1094,7 +1094,7 @@ See S/390 and zSeries Options.
>  -fno-jump-tables @gol
>  -frecord-gcc-switches @gol
>  -freg-struct-return  -fshort-enums @gol
> --fshort-double  -fshort-wchar @gol
> +-fshort-wchar @gol
>  -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
>  -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
>  -fno-stack-limit -fsplit-stack @gol
> @@ -22598,14 +22598,6 @@ is equivalent to the smallest integer type that has enough room.
>  code that is not binary compatible with code generated without that switch.
>  Use it to conform to a non-default application binary interface.
>
> -@item -fshort-double
> -@opindex fshort-double
> -Use the same size for @code{double} as for @code{float}.
> -
> -@strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
> -code that is not binary compatible with code generated without that switch.
> -Use it to conform to a non-default application binary interface.
> -
>  @item -fshort-wchar
>  @opindex fshort-wchar
>  Override the underlying type for @samp{wchar_t} to be @samp{short
> diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c
> index 08fd090..a2ce79c 100644
> --- a/gcc/lto-wrapper.c
> +++ b/gcc/lto-wrapper.c
> @@ -275,7 +275,6 @@ 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;
> @@ -500,7 +499,6 @@ 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:
> @@ -573,7 +571,6 @@ 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;
> diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
> index 9e8524a..57b4f71 100644
> --- a/gcc/lto/lto-lang.c
> +++ b/gcc/lto/lto-lang.c
> @@ -1165,7 +1165,7 @@ lto_init (void)
>    flag_generate_lto = (flag_wpa != NULL);
>
>    /* Create the basic integer types.  */
> -  build_common_tree_nodes (flag_signed_char, flag_short_double);
> +  build_common_tree_nodes (flag_signed_char, false);
>
>    /* The global tree for the main identifier is filled in by
>       language-specific front-end initialization that is not run in the
> diff --git a/gcc/testsuite/gcc.dg/lto/pr55113_0.c b/gcc/testsuite/gcc.dg/lto/pr55113_0.c
> deleted file mode 100644
> index 8c30976..0000000
> --- a/gcc/testsuite/gcc.dg/lto/pr55113_0.c
> +++ /dev/null
> @@ -1,14 +0,0 @@
> -/* PR 55113 */
> -/* { dg-lto-do link } */
> -/* { dg-lto-options { { -flto -fshort-double -O0 } } }*/
> -/* { dg-skip-if "PR60410" { x86_64-*-* || { i?86-*-* && lp64 } } } */
> -/* { dg-skip-if "PR60410" { i?86-*-solaris2.1[0-9]* } } */
> -
> -int
> -main(void)
> -{
> -  float a = 1.0;
> -  float b = 2.0;
> -  double f = a + b * 1e-12;
> -  return (int)f - 1;
> -}
> --
> 2.1.1
>



More information about the Gcc-patches mailing list