--- /dev/null
+/* PR tree-optimization/110508 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void
+foo (unsigned a, unsigned b, unsigned *c, _Bool d)
+{
+ __builtin_addc (a, b, d, c);
+}
gsi_remove (&gsi2, true);
/* Replace the re2 statement with __real__ of the newly added
.UADDC/.USUBC call. */
- gsi2 = gsi_for_stmt (re2);
- tree rlhs = gimple_assign_lhs (re2);
- g = gimple_build_assign (rlhs, REALPART_EXPR,
- build1 (REALPART_EXPR, TREE_TYPE (rlhs), nlhs));
- gsi_replace (&gsi2, g, true);
+ if (re2)
+ {
+ gsi2 = gsi_for_stmt (re2);
+ tree rlhs = gimple_assign_lhs (re2);
+ g = gimple_build_assign (rlhs, REALPART_EXPR,
+ build1 (REALPART_EXPR, TREE_TYPE (rlhs), nlhs));
+ gsi_replace (&gsi2, g, true);
+ }
if (rhs[2])
{
/* If this is the arg1 + arg2 + (ovf1 + ovf2) or