Similar to not allowing jump instructions in the generated code, we
also shouldn't allow call instructions in noce_convert_multiple_sets.
In the case of PR116358 a libcall was generated from force_operand.
PR middle-end/116358
gcc/ChangeLog:
* ifcvt.cc (noce_convert_multiple_sets): Disallow call insns.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/pr116358.c: New test.
return false;
for (insn = seq; insn; insn = NEXT_INSN (insn))
- if (JUMP_P (insn)
+ if (JUMP_P (insn) || CALL_P (insn)
|| recog_memoized (insn) == -1)
return false;
--- /dev/null
+/* PR middle-end/116358 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+long long f(int b, int c, long long d)
+{
+ if (c) {
+ long long bb = b;
+ long long t2 = (bb < 16 ? bb : 16);
+ d = t2 - 16;
+ }
+ return d;
+}
+
+/* { dg-final { scan-assembler-not "bl" } } */