From patchwork Fri Jan 7 19:36:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kai Tietz X-Patchwork-Id: 77903 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id D88B6B70CD for ; Sat, 8 Jan 2011 06:36:43 +1100 (EST) Received: (qmail 10881 invoked by alias); 7 Jan 2011 19:36:42 -0000 Received: (qmail 10765 invoked by uid 22791); 7 Jan 2011 19:36:41 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-qy0-f175.google.com (HELO mail-qy0-f175.google.com) (209.85.216.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 07 Jan 2011 19:36:36 +0000 Received: by qyk8 with SMTP id 8so810148qyk.20 for ; Fri, 07 Jan 2011 11:36:34 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.235.142 with SMTP id kg14mr22733671qcb.133.1294428994412; Fri, 07 Jan 2011 11:36:34 -0800 (PST) Received: by 10.229.214.131 with HTTP; Fri, 7 Jan 2011 11:36:34 -0800 (PST) In-Reply-To: References: <4D2718A8.6010402@redhat.com> Date: Fri, 7 Jan 2011 20:36:34 +0100 Message-ID: Subject: Re: [patch java]: Intialize va_list_type_node to avoid segfault for x86_64 targets in respect for alignment From: Kai Tietz To: "H.J. Lu" Cc: Andrew Haley , GCC Patches X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 2011/1/7 H.J. Lu : > On Fri, Jan 7, 2011 at 11:20 AM, Kai Tietz wrote: >> 2011/1/7 H.J. Lu : >>> On Fri, Jan 7, 2011 at 5:51 AM, Kai Tietz wrote: >>>> 2011/1/7 Andrew Haley : >>>>> On 01/07/2011 11:42 AM, Kai Tietz wrote: >>>>>> >>>>>> Hello, >>>>>> >>>>>> we noticed that java doesn't initialize in decl.c >>>>>> (java_init_decl_processing) the va_list_type_node. This leads to >>>>>> issues in some architectures for wrong checks and/or ICE (as for >>>>>> x86_64 one in i386.c (ix86_local_alignment)). >>>>>> >>>>>> ChangeLog >>>>>> >>>>>> 2011-01-07  Kai Tietz >>>>>> >>>>>>         * decl.c (java_init_decl_processing): Setup va_list_type_node. >>>>>> >>>>>> Tested for i686-pc-cygwin and x86_64-w64-mingw32. Ok for apply? >>>>> >>>>> Sure. >>>>> >>>>> Andrew. >>>>> >>>> >>>> Ok, applied to trunk at revision 168569. Is this patch ok for 4.5 branch, too? >>>> >>>> >>> >>> This caused: >>> >>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47215 >>> >>> >>> >>> -- >>> H.J. >>> >> >> Hmm, I see that java doesn't initialize unsigned_type_node. HJ does it >> solve the issue if you add 'unsigned_type_node = make_unsigned_type >> (INT_TYPE_SIZE);' before the target hook in java/decl.c 't = >> targetm.build_builtin_va_list ();' is called? >> > > Please send me a proper patch. > > Thanks. > > -- > H.J. > Ok, please try this patch. I am just about to do a build for 4.6 on gcc14 of gcc's cfarm. Regards, Index: decl.c =================================================================== --- decl.c (revision 168580) +++ decl.c (working copy) @@ -1153,8 +1153,8 @@ soft_lrem_node = add_builtin_function ("_Jv_remJ", t, 0, NOT_BUILT_IN, NULL, NULL_TREE); - /* Initialize va_list_type_node. */ + unsigned_type_node = make_unsigned_type (INT_TYPE_SIZE); t = targetm.build_builtin_va_list (); /* Many back-ends define record types without setting TYPE_NAME.