From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5662 invoked by alias); 10 Apr 2004 22:03:15 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 5551 invoked from network); 10 Apr 2004 22:03:11 -0000 Received: from unknown (HELO mail-out3.apple.com) (17.254.13.22) by sources.redhat.com with SMTP; 10 Apr 2004 22:03:11 -0000 Received: from mailgate2.apple.com (a17-128-100-204.apple.com [17.128.100.204]) by mail-out3.apple.com (8.12.11/8.12.11) with ESMTP id i3AM3BBO012053; Sat, 10 Apr 2004 15:03:11 -0700 (PDT) Received: from relay3.apple.com (relay3.apple.com) by mailgate2.apple.com (Content Technologies SMTPRS 4.3.6) with ESMTP id ; Sat, 10 Apr 2004 15:03:10 -0700 Received: from apple.com (vpn0priv-34.apple.com [17.219.200.34]) by relay3.apple.com (8.12.11/8.12.11) with ESMTP id i3AM387B026933; Sat, 10 Apr 2004 22:03:08 GMT Date: Sat, 10 Apr 2004 23:52:00 -0000 Subject: Re: Problems on mips-sgi-irix6.5 from hot/cold basic blocks patch Content-Type: multipart/mixed; boundary=Apple-Mail-8-248172659 Mime-Version: 1.0 (Apple Message framework v553) Cc: ctice@apple.com, gcc-bugs@gcc.gnu.org, gcc-patches@gcc.gnu.org To: "Kaveh R. Ghazi" From: Mike Stump In-Reply-To: <200404100150.i3A1o3LH027782@caip.rutgers.edu> Message-Id: X-SW-Source: 2004-04/txt/msg00912.txt.bz2 List-Id: --Apple-Mail-8-248172659 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Content-length: 2698 On Friday, April 9, 2004, at 06:50 PM, Kaveh R. Ghazi wrote: > I'm having a number of bootstrap problems on mips-sgi-irix6.5 related > to your recent checkin for hot/cold basic blocks. :-( I've checked the code, and there are a couple of problems. There is no way to default hot, cold or unlikely absent named sections. The only default, is to do what was going to be done before, like selecting the text section. > 1. Attempting to bootstrap C-only yields the following in stage1 when > building libgcc.a: > >> as0: Error: libgcc2.c, line 1:undefined assembler operation: .section >> .section .text >> as0: Error: libgcc2.c, line 1:Conflicting definition of symbol >> __muldi3 >> make[3]: *** [libgcc/mabi-32/_muldi3.o] Error 1 This should be resolved in the below patch. > 2. So I tried to bootstrap again configured with --enable-multilib=no > to avoid o32 and got this problem in stage2 exposed by -Werror: > >> varasm.c: In function `current_section_name': >> varasm.c:200: warning: enumeration value `in_unlikely_executed_text' >> not handled in switch This should be resolved in the below patch. > 3. Looking at unlikely_text_section() in varasm.c I see: > >> #ifdef TARGET_ASM_NAMED_SECTION >> named_section (NULL_TREE, UNLIKELY_EXECUTED_TEXT_SECTION_NAME, >> 0); >> #else >> in_section = in_unlikely_executed_text; >> fprintf (asm_out_file, SECTION_FORMAT_STRING, >> UNLIKELY_EXECUTED_TEXT_SECTION_NAME); >> #endif /* ifdef TARGET_ASM_NAMED_SECTION */ > > This doesn't look right. AFAICT, TARGET_ASM_NAMED_SECTION is > *always* defined, see target-def.h. So if the target doesn't > support named sections, you'll call default_no_named_section() > which calls abort(). This should be resolved in the below patch. > 4. Next, SECTION_FORMAT_STRING interacts badly with irix. I don't > understand why you overwrote TEXT_SECTION_ASM_OP. I see the > comments in your posting about needing the align. But this design > choice hoses any target which doesn't have ".section". See > problem #1. This should be resolved in the below patch. > Would you please work on fixes? I willing to help test. I'm happy check these in, if someone can confirm they help fix a broken platform. I'm on the only platform that works, so I can't do as much testing as I'd like. I did try a mips irix6.5 cross compiler, and it did what I wanted. This should get us by for a few days, until the issues can be addressed more completely. I'll work with Caroline next week and we can go though all the issues off line. Does this help anyone? If so, I'll check it in as obvious unless someone objects. --Apple-Mail-8-248172659 Content-Disposition: attachment; filename=hot-1.diffs.txt Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; x-unix-mode=0644; name="hot-1.diffs.txt" Content-length: 3971 Doing diffs in final.c.~1~: *** final.c.~1~ Sat Apr 10 09:03:33 2004 --- final.c Sat Apr 10 13:03:35 2004 *************** final_scan_insn (rtx insn, FILE *file, i *** 1722,1728 **** are writing to appropriately. */ =20=20=09=20=20 if (flag_reorder_blocks_and_partition ! && in_unlikely_text_section() && !scan_ahead_for_unlikely_executed_note (insn)) text_section (); =20=20 --- 1722,1728 ---- are writing to appropriately. */ =20=20=09=20=20 if (flag_reorder_blocks_and_partition ! && in_unlikely_text_section () && !scan_ahead_for_unlikely_executed_note (insn)) text_section (); =20=20 -------------- Doing diffs in varasm.c.~1~: *** varasm.c.~1~ Sat Apr 10 09:03:36 2004 --- varasm.c Sat Apr 10 14:47:50 2004 *************** static bool asm_emit_uninitialised (tree *** 154,161 **** unsigned HOST_WIDE_INT); static void mark_weak (tree); =0C ! enum in_section { no_section, in_text, in_unlikely_executed_text, in_data= ,=20 ! in_named #ifdef BSS_SECTION_ASM_OP , in_bss #endif --- 154,160 ---- unsigned HOST_WIDE_INT); static void mark_weak (tree); =0C ! enum in_section { no_section, in_text, in_data, in_named #ifdef BSS_SECTION_ASM_OP , in_bss #endif *************** text_section (void) *** 208,214 **** if (in_section !=3D in_text) { in_section =3D in_text; ! fprintf (asm_out_file, SECTION_FORMAT_STRING, NORMAL_TEXT_SECTION_N= AME); } } =20=20 --- 207,213 ---- if (in_section !=3D in_text) { in_section =3D in_text; ! fprintf (asm_out_file, "%s\n", TEXT_SECTION_ASM_OP); } } =20=20 *************** text_section (void) *** 217,242 **** void unlikely_text_section (void) { ! if ((in_section !=3D in_unlikely_executed_text) ! && (in_section !=3D in_named=20 ! || strcmp (in_named_name, UNLIKELY_EXECUTED_TEXT_SECTION_NAME) !=3D 0= )) { ! #ifdef TARGET_ASM_NAMED_SECTION !=20=09 ! named_section (NULL_TREE, UNLIKELY_EXECUTED_TEXT_SECTION_NAME, 0); !=20=20=20=20=20=20=20 ! #else ! in_section =3D in_unlikely_executed_text; ! fprintf (asm_out_file, SECTION_FORMAT_STRING,=20 ! UNLIKELY_EXECUTED_TEXT_SECTION_NAME); ! #endif /* ifdef TARGET_ASM_NAMED_SECTION */ ! if (!unlikely_section_label_printed) { ! fprintf (asm_out_file, "__%s_unlikely_section:\n",=20 ! current_function_name ()); ! unlikely_section_label_printed =3D true; } } } =20=20 /* Tell assembler to switch to data section. */ --- 216,236 ---- void unlikely_text_section (void) { ! if (targetm.have_named_sections) { ! if (! in_unlikely_text_section ()) { ! named_section (NULL_TREE, UNLIKELY_EXECUTED_TEXT_SECTION_NAME, 0); ! if (!unlikely_section_label_printed) ! { ! fprintf (asm_out_file, "__%s_unlikely_section:\n",=20 ! current_function_name ()); ! unlikely_section_label_printed =3D true; ! } } } + else + text_section (); } =20=20 /* Tell assembler to switch to data section. */ *************** in_text_section (void) *** 286,292 **** int in_unlikely_text_section (void) { ! return in_section =3D=3D in_unlikely_executed_text; } =20=20 /* Determine if we're in the data section. */ --- 280,287 ---- int in_unlikely_text_section (void) { ! return in_section =3D=3D in_named ! && strcmp (in_named_name, UNLIKELY_EXECUTED_TEXT_SECTION_NAME) !=3D 0; } =20=20 /* Determine if we're in the data section. */ *************** asm_output_aligned_bss (FILE *file, tree *** 528,534 **** void function_section (tree decl) { ! if (scan_ahead_for_unlikely_executed_note (get_insns())) unlikely_text_section (); else { --- 523,529 ---- void function_section (tree decl) { ! if (scan_ahead_for_unlikely_executed_note (get_insns ())) unlikely_text_section (); else { -------------- --Apple-Mail-8-248172659 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Content-length: 1 --Apple-Mail-8-248172659--