aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/config/i386/i386.md6
-rw-r--r--gcc/testsuite/gcc.dg/pr105911.c16
2 files changed, 20 insertions, 2 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 5b53841..3093cb5 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -11937,7 +11937,8 @@
rtx xops[3];
xops[0] = gen_reg_rtx (GET_MODE (operands[2]));
xops[1] = operands[2];
- xops[2] = operands[3];
+ xops[2] = GEN_INT (INTVAL (operands[3])
+ & ((<MODE_SIZE> * BITS_PER_UNIT) - 1));
ix86_expand_binary_operator (AND, GET_MODE (operands[2]), xops);
operands[2] = xops[0];
}
@@ -12905,7 +12906,8 @@
rtx xops[3];
xops[0] = gen_reg_rtx (GET_MODE (operands[2]));
xops[1] = operands[2];
- xops[2] = operands[3];
+ xops[2] = GEN_INT (INTVAL (operands[3])
+ & ((<MODE_SIZE> * BITS_PER_UNIT) - 1));
ix86_expand_binary_operator (AND, GET_MODE (operands[2]), xops);
operands[2] = xops[0];
}
diff --git a/gcc/testsuite/gcc.dg/pr105911.c b/gcc/testsuite/gcc.dg/pr105911.c
new file mode 100644
index 0000000..55df3f1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr105911.c
@@ -0,0 +1,16 @@
+/* PR target/105911 */
+/* { dg-do compile { target int128 } } */
+/* { dg-options "-O2" } */
+
+__int128 v, x;
+unsigned __int128 w;
+
+void bar (__int128, __int128);
+
+void
+foo (void)
+{
+ bar (v /= v, v >> (v &= 0x100000001));
+ bar (w /= w, w >> (w &= 0x300000003));
+ bar (x /= x, x << (x &= 0x700000007));
+}