into a noreturn function by setting TREE_THIS_VOLATILE. Normally
the local-pure-const pass is run after ix86_set_func_type is called.
When the local-pure-const pass is enabled for LTO, the interrupt
- function is marked as noreturn in the IR output, which leads the
- incompatible attribute error in LTO1. */
+ function is marked with TREE_THIS_VOLATILE in the IR output, which
+ leads to the incompatible attribute error in LTO1. Ignore the
+ interrupt function in this case. */
bool has_no_callee_saved_registers
= ((TREE_THIS_VOLATILE (fndecl)
- && lookup_attribute ("noreturn", DECL_ATTRIBUTES (fndecl))
+ && !lookup_attribute ("interrupt",
+ TYPE_ATTRIBUTES (TREE_TYPE (fndecl)))
&& optimize
&& !optimize_debug
&& (TREE_NOTHROW (fndecl) || !flag_exceptions))
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -mtune-ctrl=^prologue_using_move,^epilogue_using_move -fomit-frame-pointer" } */
+
+#define ARRAY_SIZE 256
+
+extern int array[ARRAY_SIZE][ARRAY_SIZE][ARRAY_SIZE];
+extern int value (int, int, int)
+#ifndef __x86_64__
+__attribute__ ((regparm(3)))
+#endif
+;
+
+void
+_Noreturn
+no_return_to_caller (void)
+{
+ unsigned i, j, k;
+ for (i = ARRAY_SIZE; i > 0; --i)
+ for (j = ARRAY_SIZE; j > 0; --j)
+ for (k = ARRAY_SIZE; k > 0; --k)
+ array[i - 1][j - 1][k - 1] = value (i, j, k);
+ while (1);
+}
+
+/* { dg-final { scan-assembler-not "push" } } */
+/* { dg-final { scan-assembler-not "pop" } } */