From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127307 invoked by alias); 16 Nov 2018 01:36:18 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 127294 invoked by uid 89); 16 Nov 2018 01:36:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,UNPARSEABLE_RELAY autolearn=ham version=3.3.2 spammy=CIF, cif, ipa-inline.c, Hx-languages-length:1077 X-HELO: userp2130.oracle.com Received: from userp2130.oracle.com (HELO userp2130.oracle.com) (156.151.31.86) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Nov 2018 01:36:16 +0000 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wAG1YGPc095834; Fri, 16 Nov 2018 01:36:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : message-id : content-type : mime-version : subject : date : in-reply-to : cc : to : references; s=corp-2018-07-02; bh=uYxae84rLoeaprT9H9NADk1g2hJ5WC9yLrb4t+qCXUQ=; b=LfovmVwmtKJc9T1Pd5cGiDLANLo8vE8FzsCW227GOO9amdU94QtQW2C929NscXf53lHo FcNzdN9CJs7B/2Fs7dXfH6sUNn444qjvPHVbMFGkL+uxX84s6FAjCvh9hiZJHegMUh0H kbCNU9GDUcAm1Zovzrej9m9hRFsb9OWH43mTB5Il189O/QOMPW+cVkua94nXE+LQaYJ+ MU+WrapD77XX1cgVxQkg9DhYLrqmkE8Q3m4TGy4Up/6aMdczSIRb3JexNtBmGLCzMuZO kMyC9HS/sW/s1Mqo+EtPqd+V+wM+r0ca/2OYLoPrRjXYZI550f+MJ4Hvbi1K/oUtZh5z 6A== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2nr7cscrcw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 16 Nov 2018 01:36:14 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wAG1a8Rt006612 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 16 Nov 2018 01:36:08 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wAG1a7Ml013528; Fri, 16 Nov 2018 01:36:08 GMT Received: from dhcp-10-159-148-4.vpn.oracle.com (/10.159.148.4) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 15 Nov 2018 17:36:07 -0800 From: Qing Zhao Message-Id: Content-Type: multipart/mixed; boundary="Apple-Mail=_7645B32A-1D1C-4C87-99EA-0594BD91CD9C" Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [PATCH]Come up with -flive-patching master option. Date: Fri, 16 Nov 2018 01:36:00 -0000 In-Reply-To: <49B97110-C7FD-4569-AE26-1B37951D802B@oracle.com> Cc: Miroslav Benes , Martin Jambor , live-patching@vger.kernel.org, gcc Patches To: =?utf-8?Q?Martin_Li=C5=A1ka?= , Jan Hubicka References: <1a023bdc-28a6-eb41-b449-4d096f12064f@suse.cz> <3E37D3A8-2D19-41C2-BA8A-8F0EFA1B4D5C@oracle.com> <10a54034-279b-a406-8466-55558effbf24@suse.cz> <20181003090457.GJ57692@kam.mff.cuni.cz> <54a75932-201b-671c-0a63-d1a5d8d7b562@suse.cz> <90c91045-cb9d-0bd2-fad3-d16426ceede6@suse.cz> <20181105095135.j3mnzox6rkktkoto@kam.mff.cuni.cz> <629b20d2-7b0b-9342-a64a-d12eb6e6a6b7@suse.cz> <20181108145909.5eh5ccen7a7elspe@kam.mff.cuni.cz> <173116c6-d51c-3bef-5382-38593e032f82@suse.cz> <8f467934-c088-9b60-c4d3-c19c2e03defd@suse.cz> <2F74DD05-E807-4FB4-80B1-3BBC6FEDF6E8@oracle.com> <7FA7E4B3-BF39-4E60-84AD-91161CC4867F@oracle.com> <8F7AEFF2-5DCE-49B6-BC9E-34FC0DEF2A55@oracle.com> <568496ae-! 24cf-7453-57db-a2188d5d11c2@suse.cz> <49B97110-C7FD-4569-AE26-1B37951D802B@oracle.com> X-IsSubscribed: yes X-SW-Source: 2018-11/txt/msg01413.txt.bz2 --Apple-Mail=_7645B32A-1D1C-4C87-99EA-0594BD91CD9C Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Content-length: 1042 Hi, this is the new version of the patch. I have bootstrapped it on both aarch64 and x86, no regression. please take a look. Okay for commit? thanks. Qing ================================== gcc/ChangeLog: 2018-11-15 qing zhao * cif-code.def (EXTERN_LIVE_ONLY_STATIC): New CIF code. * common.opt: Add -flive-patching flag. * doc/invoke.texi: Document -flive-patching. * flag-types.h (enum live_patching_level): New enum. * ipa-inline.c (can_inline_edge_p): Disable external functions from inlining when flag_live_patching is LIVE_PATCHING_INLINE_ONLY_STATIC. * opts.c (control_optimizations_for_live_patching): New function. (finish_options): Make flag_live_patching incompatible with flag_lto. (common_handle_option): Handle flive-patching flag. gcc/testsuite/ChangeLog: 2018-11-15 qing zhao * gcc.dg/live-patching-1.c: New test. * gcc.dg/live-patching-2.c: New test. * gcc.dg/tree-ssa/writeonly-3.c: New test. * gcc.target/i386/ipa-stack-alignment-2.c: New test. --Apple-Mail=_7645B32A-1D1C-4C87-99EA-0594BD91CD9C Content-Disposition: attachment; filename=flive-patching.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="flive-patching.patch" Content-Transfer-Encoding: quoted-printable Content-length: 14717 >From a8d98c8be081ffde19cb4497aeb09d96e5b8b771 Mon Sep 17 00:00:00 2001=0A= From: qing zhao =0A= Date: Thu, 15 Nov 2018 12:53:32 -0800=0A= Subject: [PATCH] Add a first class option -flive-patching=0A= =0A= ---=0A= gcc/cif-code.def | 6 ++=0A= gcc/common.opt | 18 ++++++=0A= gcc/doc/invoke.texi | 60 ++++++++++++++++++= +=0A= gcc/flag-types.h | 8 +++=0A= gcc/ipa-inline.c | 6 ++=0A= gcc/opts.c | 69 ++++++++++++++++++= ++++=0A= gcc/testsuite/gcc.dg/live-patching-1.c | 22 +++++++=0A= gcc/testsuite/gcc.dg/live-patching-2.c | 9 +++=0A= gcc/testsuite/gcc.dg/tree-ssa/writeonly-3.c | 20 +++++++=0A= .../gcc.target/i386/ipa-stack-alignment-2.c | 13 ++++=0A= 10 files changed, 231 insertions(+)=0A= create mode 100644 gcc/testsuite/gcc.dg/live-patching-1.c=0A= create mode 100644 gcc/testsuite/gcc.dg/live-patching-2.c=0A= create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/writeonly-3.c=0A= create mode 100644 gcc/testsuite/gcc.target/i386/ipa-stack-alignment-2.c= =0A= =0A= diff --git a/gcc/cif-code.def b/gcc/cif-code.def=0A= index 19a7621..ac3f73c 100644=0A= --- a/gcc/cif-code.def=0A= +++ b/gcc/cif-code.def=0A= @@ -132,6 +132,12 @@ DEFCIFCODE(USES_COMDAT_LOCAL, CIF_FINAL_ERROR,=0A= DEFCIFCODE(ATTRIBUTE_MISMATCH, CIF_FINAL_ERROR,=0A= N_("function attribute mismatch"))=0A= =20=0A= +/* We can't inline because the user requests only static functions=0A= + but the function has external linkage for live patching purpose. */=0A= +DEFCIFCODE(EXTERN_LIVE_ONLY_STATIC, CIF_FINAL_ERROR,=0A= + N_("function has external linkage when the user requests only"=0A= + " inlining static for live patching"))=0A= +=0A= /* We proved that the call is unreachable. */=0A= DEFCIFCODE(UNREACHABLE, CIF_FINAL_ERROR,=0A= N_("unreachable"))=0A= diff --git a/gcc/common.opt b/gcc/common.opt=0A= index 73065f5..0e4218b 100644=0A= --- a/gcc/common.opt=0A= +++ b/gcc/common.opt=0A= @@ -2164,6 +2164,24 @@ starts and when the destructor finishes.=0A= flifetime-dse=3D=0A= Common Joined RejectNegative UInteger Var(flag_lifetime_dse) Optimization = IntegerRange(0, 2)=0A= =20=0A= +flive-patching=0A= +Common RejectNegative Alias(flive-patching=3D,inline-clone) Optimization= =0A= +=0A= +flive-patching=3D=0A= +Common Report Joined RejectNegative Enum(live_patching_level) Var(flag_liv= e_patching) Init(LIVE_PATCHING_NONE) Optimization=0A= +-flive-patching=3D[inline-only-static|inline-clone] Control IPA=0A= +optimizations to provide a safe compilation for live-patching. At the same= =0A= +time, provides multiple-level control on the enabled IPA optimizations.=0A= +=0A= +Enum=0A= +Name(live_patching_level) Type(enum live_patching_level) UnknownError(unkn= own Live-Patching Level %qs)=0A= +=0A= +EnumValue=0A= +Enum(live_patching_level) String(inline-only-static) Value(LIVE_PATCHING_I= NLINE_ONLY_STATIC)=0A= +=0A= +EnumValue=0A= +Enum(live_patching_level) String(inline-clone) Value(LIVE_PATCHING_INLINE_= CLONE)=0A= +=0A= flive-range-shrinkage=0A= Common Report Var(flag_live_range_shrinkage) Init(0) Optimization=0A= Relief of register pressure through live range shrinkage.=0A= diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi=0A= index 283d20f..6719bd6 100644=0A= --- a/gcc/doc/invoke.texi=0A= +++ b/gcc/doc/invoke.texi=0A= @@ -416,6 +416,7 @@ Objective-C and Objective-C++ Dialects}.=0A= -fipa-bit-cp -fipa-vrp @gol=0A= -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference -fipa-referen= ce-addressable @gol=0A= -fipa-stack-alignment -fipa-icf -fira-algorithm=3D@var{algorithm} @gol= =0A= +-flive-patching=3D@var{level} @gol=0A= -fira-region=3D@var{region} -fira-hoist-pressure @gol=0A= -fira-loop-pressure -fno-ira-share-save-slots @gol=0A= -fno-ira-share-spill-slots @gol=0A= @@ -9045,6 +9046,65 @@ equivalences that are found only by GCC and equivale= nces found only by Gold.=0A= =20=0A= This flag is enabled by default at @option{-O2} and @option{-Os}.=0A= =20=0A= +@item -flive-patching=3D@var{level}=0A= +@opindex flive-patching=0A= +Control GCC's optimizations to provide a safe compilation for live-patchin= g.=0A= +=0A= +If the compiler's optimization uses a function's body or information extra= cted=0A= +from its body to optimize/change another function, the latter is called an= =0A= +impacted function of the former. If a function is patched, its impacted= =0A= +functions should be patched too.=0A= +=0A= +The impacted functions are decided by the compiler's interprocedural=0A= +optimizations. For example, inlining a function into its caller, cloning= =0A= +a function and changing its caller to call this new clone, or extracting= =0A= +a function's pureness/constness information to optimize its direct or=0A= +indirect callers, etc.=0A= +=0A= +Usually, the more IPA optimizations enabled, the larger the number of=0A= +impacted functions for each function. In order to control the number of=0A= +impacted functions and computed the list of impacted function easily,=0A= +we provide control to partially enable IPA optimizations on two different= =0A= +levels.=0A= +=0A= +The @var{level} argument should be one of the following:=0A= +=0A= +@table @samp=0A= +=0A= +@item inline-clone=0A= +=0A= +Only enable inlining and cloning optimizations, which includes inlining,= =0A= +cloning, interprocedural scalar replacement of aggregates and partial inli= ning.=0A= +As a result, when patching a function, all its callers and its clones'=0A= +callers need to be patched as well.=0A= +=0A= +@option{-flive-patching=3Dinline-clone} disables the following optimizatio= n flags:=0A= +@gccoptlist{-fwhole-program -fipa-pta -fipa-reference -fipa-ra @gol=0A= +-fipa-icf -fipa-icf-functions -fipa-icf-variables @gol=0A= +-fipa-bit-cp -fipa-vrp -fipa-pure-const -fipa-reference-addressable @go= l=0A= +-fipa-stack-alignment}=0A= +=0A= +@item inline-only-static=0A= +=0A= +Only enable inlining of static functions.=0A= +As a result, when patching a static function, all its callers need to be= =0A= +patches as well.=0A= +=0A= +In addition to all the flags that -flive-patching=3Dinline-clone disables,= =0A= +@option{-flive-patching=3Dinline-only-static} disables the following addit= ional=0A= +optimization flags:=0A= +@gccoptlist{-fipa-cp-clone -fipa-sra -fpartial-inlining -fipa-cp}=0A= +=0A= +@end table=0A= +=0A= +When -flive-patching specified without any value, the default value=0A= +is "inline-clone".=0A= +=0A= +This flag is disabled by default.=0A= +=0A= +Note that -flive-patching is not supported with link-time optimizer.=0A= +(@option{-flto}).=0A= +=0A= @item -fisolate-erroneous-paths-dereference=0A= @opindex fisolate-erroneous-paths-dereference=0A= Detect paths that trigger erroneous or undefined behavior due to=0A= diff --git a/gcc/flag-types.h b/gcc/flag-types.h=0A= index 500f663..2bbca65 100644=0A= --- a/gcc/flag-types.h=0A= +++ b/gcc/flag-types.h=0A= @@ -123,6 +123,14 @@ enum stack_reuse_level=0A= SR_ALL=0A= };=0A= =20=0A= +/* The live patching level. */=0A= +enum live_patching_level=0A= +{=0A= + LIVE_PATCHING_NONE =3D 0,=0A= + LIVE_PATCHING_INLINE_ONLY_STATIC,=0A= + LIVE_PATCHING_INLINE_CLONE=0A= +};=0A= +=0A= /* The algorithm used for basic block reordering. */=0A= enum reorder_blocks_algorithm=0A= {=0A= diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c=0A= index 173808a..bd6ab22 100644=0A= --- a/gcc/ipa-inline.c=0A= +++ b/gcc/ipa-inline.c=0A= @@ -379,6 +379,12 @@ can_inline_edge_p (struct cgraph_edge *e, bool report,= =0A= e->inline_failed =3D CIF_ATTRIBUTE_MISMATCH;=0A= inlinable =3D false;=0A= }=0A= + else if (callee->externally_visible=0A= + && flag_live_patching =3D=3D LIVE_PATCHING_INLINE_ONLY_STATIC)=0A= + {=0A= + e->inline_failed =3D CIF_EXTERN_LIVE_ONLY_STATIC;=0A= + inlinable =3D false;=0A= + }=0A= if (!inlinable && report)=0A= report_inline_failed_reason (e);=0A= return inlinable;=0A= diff --git a/gcc/opts.c b/gcc/opts.c=0A= index e21967b..9d237c2 100644=0A= --- a/gcc/opts.c=0A= +++ b/gcc/opts.c=0A= @@ -691,6 +691,65 @@ default_options_optimization (struct gcc_options *opts= ,=0A= lang_mask, handlers, loc, dc);=0A= }=0A= =20=0A= +/* Control IPA optimizations based on different live patching LEVEL. */= =0A= +static void=0A= +control_optimizations_for_live_patching (struct gcc_options *opts,=0A= + struct gcc_options *opts_set,=0A= + enum live_patching_level level)=0A= +{=0A= + gcc_assert (level > LIVE_PATCHING_NONE);=0A= +=0A= + switch (level)=0A= + {=0A= + case LIVE_PATCHING_INLINE_ONLY_STATIC:=0A= + if (!opts_set->x_flag_ipa_cp_clone)=0A= + opts->x_flag_ipa_cp_clone =3D 0;=0A= + if (!opts_set->x_flag_ipa_sra)=0A= + opts->x_flag_ipa_sra =3D 0;=0A= + if (!opts_set->x_flag_partial_inlining)=0A= + opts->x_flag_partial_inlining =3D 0;=0A= + if (!opts_set->x_flag_ipa_cp)=0A= + opts->x_flag_ipa_cp =3D 0;=0A= + /* FALLTHROUGH. */=0A= + case LIVE_PATCHING_INLINE_CLONE:=0A= + /* live patching should disable whole-program optimization. */=0A= + if (!opts_set->x_flag_whole_program)=0A= + opts->x_flag_whole_program =3D 0;=0A= + /* visibility change should be excluded by !flag_whole_program=0A= + && !in_lto_p && !flag_ipa_cp_clone && !flag_ipa_sra=0A= + && !flag_partial_inlining. */=0A= + if (!opts_set->x_flag_ipa_pta)=0A= + opts->x_flag_ipa_pta =3D 0;=0A= + if (!opts_set->x_flag_ipa_reference)=0A= + opts->x_flag_ipa_reference =3D 0;=0A= + if (!opts_set->x_flag_ipa_ra)=0A= + opts->x_flag_ipa_ra =3D 0;=0A= + if (!opts_set->x_flag_ipa_icf)=0A= + opts->x_flag_ipa_icf =3D 0;=0A= + if (!opts_set->x_flag_ipa_icf_functions)=0A= + opts->x_flag_ipa_icf_functions =3D 0;=0A= + if (!opts_set->x_flag_ipa_icf_variables)=0A= + opts->x_flag_ipa_icf_variables =3D 0;=0A= + if (!opts_set->x_flag_ipa_bit_cp)=0A= + opts->x_flag_ipa_bit_cp =3D 0;=0A= + if (!opts_set->x_flag_ipa_vrp)=0A= + opts->x_flag_ipa_vrp =3D 0;=0A= + if (!opts_set->x_flag_ipa_pure_const)=0A= + opts->x_flag_ipa_pure_const =3D 0;=0A= + /* FIXME: disable unreachable code removal. */=0A= +=0A= + /* discovery of functions/variables with no address taken. */=0A= + if (!opts_set->x_flag_ipa_reference_addressable)=0A= + opts->x_flag_ipa_reference_addressable =3D 0;=0A= + /* ipa stack alignment propagation. */=0A= + if (!opts_set->x_flag_ipa_stack_alignment)=0A= + opts->x_flag_ipa_stack_alignment =3D 0;=0A= + break;=0A= + default:=0A= + gcc_unreachable ();=0A= + }=0A= +}=0A= +=0A= /* After all options at LOC have been read into OPTS and OPTS_SET,=0A= finalize settings of those options and diagnose incompatible=0A= combinations. */=0A= @@ -1040,6 +1099,10 @@ finish_options (struct gcc_options *opts, struct gcc= _options *opts_set,=0A= if ((opts->x_flag_sanitize & SANITIZE_KERNEL_ADDRESS) && opts->x_flag_tm= )=0A= sorry ("transactional memory is not supported with "=0A= "%<-fsanitize=3Dkernel-address%>");=0A= +=0A= + /* Currently live patching is not support for LTO. */=0A= + if (opts->x_flag_live_patching && opts->x_flag_lto)=0A= + sorry ("live patching is not supported with LTO");=0A= }=0A= =20=0A= #define LEFT_COLUMN 27=0A= @@ -2266,6 +2329,12 @@ common_handle_option (struct gcc_options *opts,=0A= (&opts->x_flag_instrument_functions_exclude_files, arg);=0A= break;=0A= =20=0A= + case OPT_flive_patching_:=0A= + if (value)=0A= + control_optimizations_for_live_patching (opts, opts_set,=0A= + opts->x_flag_live_patching);=0A= + break;=0A= +=0A= case OPT_fmessage_length_:=0A= pp_set_line_maximum_length (dc->printer, value);=0A= diagnostic_set_caret_max_width (dc, value);=0A= diff --git a/gcc/testsuite/gcc.dg/live-patching-1.c b/gcc/testsuite/gcc.dg/= live-patching-1.c=0A= new file mode 100644=0A= index 0000000..6a1ea38=0A= --- /dev/null=0A= +++ b/gcc/testsuite/gcc.dg/live-patching-1.c=0A= @@ -0,0 +1,22 @@=0A= +/* { dg-do compile } */=0A= +/* { dg-options "-O2 -flive-patching=3Dinline-only-static -fdump-ipa-inlin= e" } */=0A= +=0A= +extern int sum, n, m;=0A= +=0A= +int foo (int a)=0A= +{=0A= + return a + n;=0A= +}=0A= +=0A= +static int bar (int b)=0A= +{=0A= + return b * m;=0A= +}=0A= +=0A= +int main()=0A= +{=0A= + sum =3D foo (m) + bar (n);=20=0A= + return 0;=0A= +}=0A= +=0A= +/* { dg-final { scan-ipa-dump "foo/0 function has external linkage when th= e user requests only inlining static for live patching" "inline" } } */=0A= diff --git a/gcc/testsuite/gcc.dg/live-patching-2.c b/gcc/testsuite/gcc.dg/= live-patching-2.c=0A= new file mode 100644=0A= index 0000000..b418aaf=0A= --- /dev/null=0A= +++ b/gcc/testsuite/gcc.dg/live-patching-2.c=0A= @@ -0,0 +1,9 @@=0A= +/* { dg-do compile } */=0A= +/* { dg-options "-O2 -flive-patching -flto" } */=0A= +=0A= +int main()=0A= +{=0A= + return 0;=0A= +}=0A= +=0A= +/* { dg-message "sorry, unimplemented: live patching is not supported with= LTO" "-flive-patching and -flto together" { target *-*-* } 0 } */=0A= diff --git a/gcc/testsuite/gcc.dg/tree-ssa/writeonly-3.c b/gcc/testsuite/gc= c.dg/tree-ssa/writeonly-3.c=0A= new file mode 100644=0A= index 0000000..4be4cf7=0A= --- /dev/null=0A= +++ b/gcc/testsuite/gcc.dg/tree-ssa/writeonly-3.c=0A= @@ -0,0 +1,20 @@=0A= +/* { dg-do compile } */=0A= +/* { dg-options "-O1 -fdump-tree-optimized -flive-patching" } */=0A= +static struct a {int magic1,b;} a;=0A= +volatile int magic2;=0A= +static struct b {int a,b,c,d,e,f;} magic3;=0A= +=0A= +struct b foo();=0A= +=0A= +void=0A= +t()=0A= +{=0A= + a.magic1 =3D 1;=0A= + magic2 =3D 1;=0A= + magic3 =3D foo();=0A= +}=0A= +/* { dg-final { scan-tree-dump "magic1" "optimized"} } */=0A= +/* { dg-final { scan-tree-dump "magic3" "optimized"} } */=0A= +/* { dg-final { scan-tree-dump "magic2" "optimized"} } */=0A= +/* { dg-final { scan-tree-dump "foo" "optimized"} } */=0A= +=20=0A= diff --git a/gcc/testsuite/gcc.target/i386/ipa-stack-alignment-2.c b/gcc/te= stsuite/gcc.target/i386/ipa-stack-alignment-2.c=0A= new file mode 100644=0A= index 0000000..8ba7000=0A= --- /dev/null=0A= +++ b/gcc/testsuite/gcc.target/i386/ipa-stack-alignment-2.c=0A= @@ -0,0 +1,13 @@=0A= +/* { dg-do compile } */=0A= +/* { dg-options "-flive-patching -O" } */=0A= +=0A= +typedef struct {=0A= + long a;=0A= + long b[];=0A= +} c;=0A= +=0A= +c *d;=0A= +void e() { d->b[0] =3D 5; }=0A= +void f() { e(); }=0A= +=0A= +/* { dg-final { scan-assembler "sub.*%.sp" } } */=0A= --=20=0A= 1.9.1=0A= --Apple-Mail=_7645B32A-1D1C-4C87-99EA-0594BD91CD9C--