http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60827
Bug ID: 60827
Summary: Inconsistent optimize_function_for_speed_p in
*fixuns_trunc<mode>_1
Product: gcc
Version: 4.10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: hjl.tools at gmail dot com
CC: ubizjak at gmail dot com
i386.md has
(define_expand "fixuns_trunc<mode>si2"
[(parallel
[(set (match_operand:SI 0 "register_operand")
(unsigned_fix:SI
(match_operand:MODEF 1 "nonimmediate_operand")))
(use (match_dup 2))
(clobber (match_scratch:<ssevecmode> 3))
(clobber (match_scratch:<ssevecmode> 4))])]
"!TARGET_64BIT && TARGET_SSE2 && TARGET_SSE_MATH"
{
enum machine_mode mode = <MODE>mode;
enum machine_mode vecmode = <ssevecmode>mode;
REAL_VALUE_TYPE TWO31r;
rtx two31;
if (optimize_insn_for_size_p ())
FAIL;
real_ldexp (&TWO31r, &dconst1, 31);
two31 = const_double_from_real_value (TWO31r, mode);
two31 = ix86_build_const_vector (vecmode, true, two31);
operands[2] = force_reg (vecmode, two31);
})
(define_insn_and_split "*fixuns_trunc<mode>_1"
[(set (match_operand:SI 0 "register_operand" "=&x,&x")
(unsigned_fix:SI
(match_operand:MODEF 3 "nonimmediate_operand" "xm,xm")))
(use (match_operand:<ssevecmode> 4 "nonimmediate_operand" "m,x"))
(clobber (match_scratch:<ssevecmode> 1 "=x,&x"))
(clobber (match_scratch:<ssevecmode> 2 "=x,x"))]
"!TARGET_64BIT && TARGET_SSE2 && TARGET_SSE_MATH
&& optimize_function_for_speed_p (cfun)"
"#"
"&& reload_completed"
[(const_int 0)]
{
ix86_split_convert_uns_si_sse (operands);
DONE;
})
Since fixuns_trunc<mode>si2 expander checks optimize_insn_for_size_p
before generating *fixuns_trunc<mode>_1, we should use
optimize_insn_for_speed_p in *fixuns_trunc<mode>_1 for consistency.