On Tue, Mar 4, 2014 at 12:02 PM, Paulo J. Matos <pa...@matos-sorge.com> wrote:
> On 03/03/14 09:56, Richard Biener wrote:
>>
>> Index: gcc/c-family/c.opt
>> ===================================================================
>> --- gcc/c-family/c.opt  (revision 208249)
>> +++ 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
>>
>> This hunk isn't needed.
>>
>> Index: gcc/testsuite/gcc.target/powerpc/pr55113.c
>> ===================================================================
>> --- gcc/testsuite/gcc.target/powerpc/pr55113.c  (revision 0)
>> +++ gcc/testsuite/gcc.target/powerpc/pr55113.c  (working copy)
>> @@ -0,0 +1,11 @@
>> +#include <stdio.h>
>> +
>> +int main()
>> +{
>> +       static float f;
>> +       float a = 1.0;
>> +       float b = 2.0;
>> +       f = a + b * 1e-12;
>> +       printf("%f\n", f);
>> +       return 0;
>> +}
>>
>> that doesn't seem to be run with -flto nor -fshort-double.  The proper
>> place for a testcase is gcc.dg/lto/ with sth like
>>
>> { dg-lto-do link }
>> { dg-lto-options { { -O2 -fshort-double -flto } } }
>>
>> and naming the testcase pr55113_0.c.  Your testcase doens't use
>> doubles at all ... (well, ok, a + b * 1e-12 uses them implicitely, but
>> for that we have fsingle-precision-constant)
>>
>> Richard.
>>
>>> --
>>> PMatos
>>
>>
>
> Thanks for all your comments. I have updated the patch to reflect your
> comments and concerns.
>
> 2014-03-04  Paulo Matos  <pa...@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  <pa...@matos-sorge.com>
>
>         * gcc.dg/lto/pr55113_0.c: New testcase.
>
> There is an issue opened by this bug. i386 fails the test but not due to
> lto. It fails due to short-double:
> $ top-trunk/toolchain/install-native/bin/gcc -O2 -o test pr55113_0.c
> -fshort-double
> <built-in>: internal compiler error: in layout_type, at stor-layout.c:2116
> 0xb36233 layout_type(tree_node*)
>         ../../../src/gcc/gcc/stor-layout.c:2115
> 0xdf8998 make_vector_type
>         ../../../src/gcc/gcc/tree.c:9431
> 0xdfbb87 build_vector_type_for_mode(tree_node*, machine_mode)
>         ../../../src/gcc/gcc/tree.c:10205
> 0xe8dd57 ix86_get_builtin_type
>         ../../../src/gcc/gcc/config/i386/i386.c:27021
> 0xe8de95 ix86_get_builtin_func_type
>         ../../../src/gcc/gcc/config/i386/i386.c:27071
> 0xe8dfa1 def_builtin
>         ../../../src/gcc/gcc/config/i386/i386.c:28787
> 0xe8e662 ix86_init_mmx_sse_builtins
>         ../../../src/gcc/gcc/config/i386/i386.c:30724
> 0xe92e8f ix86_init_builtins
>         ../../../src/gcc/gcc/config/i386/i386.c:32677
> 0x62c692 c_define_builtins
>         ../../../src/gcc/gcc/c-family/c-common.c:5268
> 0x62e09c c_common_nodes_and_builtins()
>         ../../../src/gcc/gcc/c-family/c-common.c:5712
> 0x57b859 c_init_decl_processing()
>         ../../../src/gcc/gcc/c/c-decl.c:3550
> 0x5d260f c_objc_common_init()
>         ../../../src/gcc/gcc/c/c-objc-common.c:63
> 0xb4333c lang_dependent_init
>         ../../../src/gcc/gcc/toplev.c:1712
> 0xb4374a do_compile
>         ../../../src/gcc/gcc/toplev.c:1900
> Please submit a full bug report,
> with preprocessed source if appropriate.
> Please include the complete backtrace with any bug report.
> See <http://gcc.gnu.org/bugs.html> for instructions.
>
>
> I think we can close PR55113 and open a new bug for i386 and fshort-double
> usage if there isn't one open already?
>
> OK to commit and close bug?

It works fine on i386 for me but fails on x86_64.  Please add a

/* { dg-skip-if "PR-you-open" { { x86_64-*-* i?86-*-* } && lp64 } {
"*" } { "" } } */

to the testcase to avoid the regression in the testsuite.

-fshort-double doesn't seem to work at all on 64bit x86.

Ok with that change.

Thanks,
Richard.

> --
> PMatos

Reply via email to