summaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@cygnus.com>1998-10-04 16:59:58 -0700
committerRichard Henderson <rth@gcc.gnu.org>1998-10-04 16:59:58 -0700
commit861556b4d97e7b323621cb19ada8bbfefff26977 (patch)
treec3ad8ec16738d3413956374c5ef8903d2301cd47 /gcc/combine.c
parent12a27dfc4e83a8e450b98063efc0b38207050000 (diff)
downloadgcc-861556b4d97e7b323621cb19ada8bbfefff26977.tar.gz
combine.c (expand_field_assignment): Don't do bitwise operations on MODE_FLOAT; pun to MODE_INT if possible.
* combine.c (expand_field_assignment): Don't do bitwise operations on MODE_FLOAT; pun to MODE_INT if possible. From-SVN: r22826
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index e2a0095a1db..ce488e294c4 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -5384,6 +5384,24 @@ expand_field_assignment (x)
compute_mode = GET_MODE (inner);
+ /* Don't attempt bitwise arithmetic on non-integral modes. */
+ if (! INTEGRAL_MODE_P (compute_mode))
+ {
+ enum machine_mode imode;
+
+ /* Something is probably seriously wrong if this matches. */
+ if (! FLOAT_MODE_P (compute_mode))
+ break;
+
+ /* Try to find an integral mode to pun with. */
+ imode = mode_for_size (GET_MODE_BITSIZE (compute_mode), MODE_INT, 0);
+ if (imode == BLKmode)
+ break;
+
+ compute_mode = imode;
+ inner = gen_lowpart_for_combine (imode, inner);
+ }
+
/* Compute a mask of LEN bits, if we can do this on the host machine. */
if (len < HOST_BITS_PER_WIDE_INT)
mask = GEN_INT (((HOST_WIDE_INT) 1 << len) - 1);