* config/i386/i386.c (ix86_function_regparm): Save an extra
register for -fsplit-stack with DECL_STATIC_CHAIN.
From-SVN: r246286
+2017-03-20 Ian Lance Taylor <iant@google.com>
+
+ * config/i386/i386.c (ix86_function_regparm): Save an extra
+ register for -fsplit-stack with DECL_STATIC_CHAIN.
+
2017-03-17 Palmer Dabbelt <palmer@dabbelt.com>
PR target/79912
local_regparm = 2;
/* Save a register for the split stack. */
- if (local_regparm == 3 && flag_split_stack)
- local_regparm = 2;
+ if (flag_split_stack)
+ {
+ if (local_regparm == 3)
+ local_regparm = 2;
+ else if (local_regparm == 2
+ && DECL_STATIC_CHAIN (target->decl))
+ local_regparm = 1;
+ }
/* Each fixed register usage increases register pressure,
so less registers should be used for argument passing.