aboutsummaryrefslogtreecommitdiff
path: root/gcc/optabs.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2003-02-26 12:09:33 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2003-02-26 11:09:33 +0000
commit0d446150c298b2048d18e354ee47b130ed3b8e7f (patch)
treeddc33e157eac05f7cef3bb3604e16a7dd67cba78 /gcc/optabs.c
parent9541e2e3d91f99cacd1cd724a956019281e760d5 (diff)
downloadgcc-0d446150c298b2048d18e354ee47b130ed3b8e7f.zip
gcc-0d446150c298b2048d18e354ee47b130ed3b8e7f.tar.gz
gcc-0d446150c298b2048d18e354ee47b130ed3b8e7f.tar.bz2
objc-act.c: Include cgraph.h
* objc-act.c: Include cgraph.h (mark_referenced_methods): New function. (objc_init): Call it. * objc-lang.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Set. * c-decl.c (finish_function): Honor can_defer_p even in unit-at-a-time mode. * optabs.c (expand_fix): Do not widen the input operand. * expr.c (emit_group_store): Fix crash when converting single register into complex register. * Makefile.in (jump.o, regclass.o, alias.o): Add dependency on timevar.h * alias.c: Include timevar.h (init_alias_analysis): Set timevar * jump.c: Include timevar.h (rebuild_jump_labels): Set timevar * regcalss.c: Include timevar.h (reg_scan): Set timevar * timevar.def (TV_ALIAS_ANALYSIS, TV_REG_SCAN, TV_REBUILD_JUMP): New From-SVN: r63464
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r--gcc/optabs.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 93b1498..e30e477 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -5119,15 +5119,26 @@ expand_fix (to, from, unsignedp)
one plus the highest signed number, convert, and add it back.
We only need to check all real modes, since we know we didn't find
- anything with a wider integer mode. */
+ anything with a wider integer mode.
+
+ This code used to extend FP value into mode wider than the destination.
+ This is not needed. Consider, for instance conversion from SFmode
+ into DImode.
+
+ The hot path trought the code is dealing with inputs smaller than 2^63
+ and doing just the conversion, so there is no bits to lose.
+
+ In the other path we know the value is positive in the range 2^63..2^64-1
+ inclusive. (as for other imput overflow happens and result is undefined)
+ So we know that the most important bit set in mantisa corresponds to
+ 2^63. The subtraction of 2^63 should not generate any rounding as it
+ simply clears out that bit. The rest is trivial. */
if (unsignedp && GET_MODE_BITSIZE (GET_MODE (to)) <= HOST_BITS_PER_WIDE_INT)
for (fmode = GET_MODE (from); fmode != VOIDmode;
fmode = GET_MODE_WIDER_MODE (fmode))
- /* Make sure we won't lose significant bits doing this. */
- if (GET_MODE_BITSIZE (fmode) > GET_MODE_BITSIZE (GET_MODE (to))
- && CODE_FOR_nothing != can_fix_p (GET_MODE (to), fmode, 0,
- &must_trunc))
+ if (CODE_FOR_nothing != can_fix_p (GET_MODE (to), fmode, 0,
+ &must_trunc))
{
int bitsize;
REAL_VALUE_TYPE offset;