From patchwork Tue Jan 11 15:10:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kai Tietz X-Patchwork-Id: 78397 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 76A40B70A9 for ; Wed, 12 Jan 2011 02:10:54 +1100 (EST) Received: (qmail 14683 invoked by alias); 11 Jan 2011 15:10:42 -0000 Received: (qmail 14668 invoked by uid 22791); 11 Jan 2011 15:10:39 -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-qw0-f47.google.com (HELO mail-qw0-f47.google.com) (209.85.216.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 11 Jan 2011 15:10:32 +0000 Received: by qwi2 with SMTP id 2so5134015qwi.20 for ; Tue, 11 Jan 2011 07:10:30 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.192.149 with SMTP id dq21mr15104232qcb.57.1294758630332; Tue, 11 Jan 2011 07:10:30 -0800 (PST) Received: by 10.229.214.131 with HTTP; Tue, 11 Jan 2011 07:10:30 -0800 (PST) In-Reply-To: References: Date: Tue, 11 Jan 2011 16:10:30 +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: Andreas Schwab Cc: GCC Patches , Andrew Haley 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/11 Kai Tietz : > 2011/1/11 Andreas Schwab : >> Kai Tietz writes: >> >>> Index: gcc/gcc/java/decl.c >>> =================================================================== >>> --- gcc.orig/gcc/java/decl.c  2010-12-15 14:28:00.000000000 +0100 >>> +++ gcc/gcc/java/decl.c       2011-01-07 12:28:26.951395700 +0100 >>> @@ -1154,6 +1154,19 @@ java_init_decl_processing (void) >>>      = add_builtin_function ("_Jv_remJ", t, >>>                           0, NOT_BUILT_IN, NULL, NULL_TREE); >>> >>> +  /* Initialize va_list_type_node.  */ >>> +  t = targetm.build_builtin_va_list (); >> >> That doesn't work. >> >> Program received signal SIGSEGV, Segmentation fault. >> place_field (rli=0x10c8c590, field=0xf7eb15a0) at ../../gcc/stor-layout.c:1132 >> 1132      else if (TREE_CODE (type) == ERROR_MARK) >> (gdb) bt >> #0  place_field (rli=0x10c8c590, field=0xf7eb15a0) >>    at ../../gcc/stor-layout.c:1132 >> #1  0x103e1398 in layout_type (type=0xf7eb1540) at ../../gcc/stor-layout.c:2095 >> #2  layout_type (type=0xf7eb1540) at ../../gcc/stor-layout.c:1849 >> #3  0x105ee484 in rs6000_build_builtin_va_list () >>    at ../../gcc/config/rs6000/rs6000.c:9435 >> #4  rs6000_build_builtin_va_list () at ../../gcc/config/rs6000/rs6000.c:9390 >> #5  0x100a8668 in java_init_decl_processing () at ../../gcc/java/decl.c:1158 >> #6  0x100bea78 in java_init () at ../../gcc/java/lang.c:324 >> #7  0x103eb9c4 in lang_dependent_init (argc=1, argv=0xffffe204) >>    at ../../gcc/toplev.c:1738 >> #8  do_compile (argc=1, argv=0xffffe204) at ../../gcc/toplev.c:1873 >> #9  toplev_main (argc=1, argv=0xffffe204) at ../../gcc/toplev.c:1937 >> #10 0x1008d310 in main (argc=, argv=) >>    at ../../gcc/main.c:36 >> >> Andreas. >> >> -- >> Andreas Schwab, schwab@redhat.com >> GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84  5EC7 45C6 250E 6F00 984E >> "And now for something completely different." >> > > Ok, there is another target using for va_list_type_node record another > unitialized type-node ... Let me see ... > Yes, rs9000 uses here unsigned_char_type_node, which isn't intialized by java. Following patch should solve your issue: Ok for apply, if it solves the issue? Regards, Kai Index: decl.c =================================================================== --- decl.c (revision 168662) +++ decl.c (working copy) @@ -1154,6 +1154,7 @@ = add_builtin_function ("_Jv_remJ", t, 0, NOT_BUILT_IN, NULL, NULL_TREE); /* Initialize va_list_type_node. */ + unsigned_char_type_node = make_unsigned_type (CHAR_TYPE_SIZE); unsigned_type_node = make_unsigned_type (INT_TYPE_SIZE); long_integer_type_node = make_signed_type (LONG_TYPE_SIZE);