From: Ian Lance Taylor Date: Mon, 20 Mar 2017 17:43:08 +0000 (+0000) Subject: i386.c (ix86_function_regparm): Save an extra register for -fsplit-stack with DECL_ST... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dd629845b0931912853a26bf8f8e05adf9f048a2;p=gcc.git i386.c (ix86_function_regparm): Save an extra register for -fsplit-stack with DECL_STATIC_CHAIN. * config/i386/i386.c (ix86_function_regparm): Save an extra register for -fsplit-stack with DECL_STATIC_CHAIN. From-SVN: r246286 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7164d10df6b..1385d92bcdf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-03-20 Ian Lance Taylor + + * config/i386/i386.c (ix86_function_regparm): Save an extra + register for -fsplit-stack with DECL_STATIC_CHAIN. + 2017-03-17 Palmer Dabbelt PR target/79912 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index f58d529604c..259f97b5a10 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -7975,8 +7975,14 @@ ix86_function_regparm (const_tree type, const_tree decl) 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.