Hi Jakub, This simple patch fixes the -m32 -mno-sse bugs you reported. A few more places where I did not change references to global_options. Uros/Richard: Is this ok to commit?
* config/i386/i386.c (ix86_option_override_internal): Change TARGET_SSE2 to TARGET_SSE2_P (opts->...) (ix86_valid_target_attribute_tree): Change TARGET_64BIT to TARGET_64BIT_P (opts->...) Change TARGET_SSE to TARGET_SSE_P (opts->...) Thanks Sri On Fri, Oct 18, 2013 at 7:10 PM, Sriraman Tallam <tmsri...@google.com> wrote: > On Thu, Oct 17, 2013 at 3:10 PM, Jakub Jelinek <ja...@redhat.com> wrote: >> On Thu, Oct 17, 2013 at 12:30:46PM -0700, Sriraman Tallam wrote: >>> I checked my build again for these tests and they all pass. >> >> Even on x86_64-linux I can reproduce all of those with >> -m32 -mno-sse. > > Figured out why this happens in -m32 -mno-sse mode. This simple patch > that will fix it Basically, there are a couple of more places where > references to global_options need to be fixed. . I am consolidating > the patch for all the x86 test case failures into one patch which I > will later send out for review. > > Index: config/i386/i386.c > =================================================================== > --- config/i386/i386.c (revision 203830) > +++ config/i386/i386.c (working copy) > @@ -3810,7 +3810,7 @@ ix86_option_override_internal (bool main_args_p, > codegen. We may switch to 387 with -ffast-math for size optimized > functions. */ > else if (fast_math_flags_set_p (&global_options) > - && TARGET_SSE2) > + && TARGET_SSE2_P (opts->x_ix86_isa_flags)) > ix86_fpmath = FPMATH_SSE; > else > opts->x_ix86_fpmath = TARGET_FPMATH_DEFAULT_P (opts->x_ix86_isa_flags); > @@ -4566,7 +4566,8 @@ ix86_valid_target_attribute_tree (tree args, > /* If fpmath= is not set, and we now have sse2 on 32-bit, use it. */ > if (enum_opts_set.x_ix86_fpmath) > opts_set->x_ix86_fpmath = (enum fpmath_unit) 1; > - else if (!TARGET_64BIT && TARGET_SSE) > + else if (!TARGET_64BIT_P (opts->x_ix86_isa_flags) > + && TARGET_SSE_P (opts->x_ix86_isa_flags)) > { > opts->x_ix86_fpmath = (enum fpmath_unit) (FPMATH_SSE | FPMATH_387); > >> >> Jakub
Index: gcc/config/i386/i386.c =================================================================== --- gcc/config/i386/i386.c (revision 203929) +++ gcc/config/i386/i386.c (working copy) @@ -3798,7 +3798,7 @@ ix86_option_override_internal (bool main_args_p, codegen. We may switch to 387 with -ffast-math for size optimized functions. */ else if (fast_math_flags_set_p (&global_options) - && TARGET_SSE2) + && TARGET_SSE2_P (opts->x_ix86_isa_flags)) ix86_fpmath = FPMATH_SSE; else opts->x_ix86_fpmath = TARGET_FPMATH_DEFAULT_P (opts->x_ix86_isa_flags); @@ -4553,7 +4553,8 @@ ix86_valid_target_attribute_tree (tree args, /* If fpmath= is not set, and we now have sse2 on 32-bit, use it. */ if (enum_opts_set.x_ix86_fpmath) opts_set->x_ix86_fpmath = (enum fpmath_unit) 1; - else if (!TARGET_64BIT && TARGET_SSE) + else if (!TARGET_64BIT_P (opts->x_ix86_isa_flags) + && TARGET_SSE_P (opts->x_ix86_isa_flags)) { opts->x_ix86_fpmath = (enum fpmath_unit) (FPMATH_SSE | FPMATH_387); opts_set->x_ix86_fpmath = (enum fpmath_unit) 1;