summaryrefslogtreecommitdiff
path: root/gcc/regrename.c
diff options
context:
space:
mode:
authorUros Bizjak <uros@gcc.gnu.org>2008-09-18 12:17:42 +0200
committerUros Bizjak <uros@gcc.gnu.org>2008-09-18 12:17:42 +0200
commit02bb8bce3b2320851f33ea3ab5fae6f575878670 (patch)
treed51fb55aa9413a7aeb275dc45346fdedf41db963 /gcc/regrename.c
parentd9e74dfcc1f54a2b34fa12468cc3ca884058a6f1 (diff)
downloadgcc-02bb8bce3b2320851f33ea3ab5fae6f575878670.tar.gz
re PR rtl-optimization/37544 (Conversion double -> unsigned long long -> unsigned -> double gives wrong results)
PR rtl-optimization/37544 * regrename.c (maybe_mode_change): Exit early when copy_mode is narrower than orig_mode and narrower than new_mode. testsuite/ChangeLog: PR rtl-optimization/37544 * gcc.dg/pr37544.c: New test. From-SVN: r140446
Diffstat (limited to 'gcc/regrename.c')
-rw-r--r--gcc/regrename.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/regrename.c b/gcc/regrename.c
index bd2373cbb5a..e70dae8d139 100644
--- a/gcc/regrename.c
+++ b/gcc/regrename.c
@@ -1314,6 +1314,10 @@ maybe_mode_change (enum machine_mode orig_mode, enum machine_mode copy_mode,
enum machine_mode new_mode, unsigned int regno,
unsigned int copy_regno ATTRIBUTE_UNUSED)
{
+ if (GET_MODE_SIZE (copy_mode) < GET_MODE_SIZE (orig_mode)
+ && GET_MODE_SIZE (copy_mode) < GET_MODE_SIZE (new_mode))
+ return NULL_RTX;
+
if (orig_mode == new_mode)
return gen_rtx_raw_REG (new_mode, regno);
else if (mode_change_ok (orig_mode, new_mode, regno))