else if (TREE_CODE (var) == MEM_REF && tree_fits_uhwi_p (idx))
{
ret
- = build2 (MEM_REF, ltype, TREE_OPERAND (var, 0),
+ = build2 (MEM_REF, ltype, unshare_expr (TREE_OPERAND (var, 0)),
size_binop (PLUS_EXPR, TREE_OPERAND (var, 1),
build_int_cst (TREE_TYPE (TREE_OPERAND (var, 1)),
tree_to_uhwi (idx)
= build_qualified_type (ltype,
TYPE_QUALS (ltype)
| ENCODE_QUAL_ADDR_SPACE (as));
- rhs1 = build1 (VIEW_CONVERT_EXPR, ltype, mem);
+ rhs1 = build1 (VIEW_CONVERT_EXPR, ltype, unshare_expr (mem));
gimple_assign_set_rhs1 (stmt, rhs1);
}
else
--- /dev/null
+/* PR middle-end/114209 */
+/* { dg-do compile { target bitint } } */
+/* { dg-options "-Og -std=c23 -fno-strict-aliasing" } */
+/* { dg-add-options float128 } */
+/* { dg-require-effective-target float128 } */
+
+typedef signed char V __attribute__((__vector_size__(16)));
+typedef _Float128 W __attribute__((__vector_size__(16)));
+
+_Float128
+foo (void *p)
+{
+ signed char c = *(_BitInt(128) *) p;
+ _Float128 f = *(_Float128 *) p;
+ W w = *(W *) p;
+ signed char r = ((union { W a; signed char b[16]; }) w).b[1];
+ return r + f;
+}