@@ -445,6 +445,11 @@ emit_call_1 (rtx funexp, tree fntree ATT
if (SUPPORTS_STACK_ALIGNMENT)
crtl->need_drap = true;
}
+ /* For noreturn calls when not accumulating outgoing args force
+ REG_ARGS_SIZE note to prevent crossjumping of calls with different
+ args sizes. */
+ else if (!ACCUMULATE_OUTGOING_ARGS && (ecf_flags & ECF_NORETURN) != 0)
+ add_reg_note (call_insn, REG_ARGS_SIZE, GEN_INT (stack_pointer_delta));
if (!ACCUMULATE_OUTGOING_ARGS)
{
@@ -0,0 +1,19 @@
+/* PR debug/51762 */
+/* { dg-do compile } */
+/* { dg-options "-g -Os -fomit-frame-pointer -fno-asynchronous-unwind-tables" } */
+
+void noret (void) __attribute__ ((noreturn));
+int bar (void);
+void baz (const char *);
+static int v = -1;
+
+void
+foo (void)
+{
+ if (bar () && v == -1)
+ {
+ baz ("baz");
+ noret ();
+ }
+ noret ();
+}