From 57d138a946002b7d49af7e287abbe4efa2fa7492 Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Fri, 23 Dec 2011 01:53:13 +0000 Subject: [PATCH] re PR middle-end/51252 (FAIL: c-c++-common/tm/freq.c (internal compiler error)) PR middle-end/51252 * config/pa/pa.c (pa_som_tm_clone_table_section): New function. (som_tm_clone_table_section): Declare. (pa_file_start_space): Create $TM_CLONE_TABLE$ subspace. (pa_som_asm_init_sections): Init som_tm_clone_table_section. * config/pa/som.h (TARGET_ASM_TM_CLONE_TABLE_SECTION): Define. From-SVN: r182646 --- gcc/ChangeLog | 9 +++++++++ gcc/config/pa/pa.c | 25 +++++++++++++++++++++---- gcc/config/pa/som.h | 2 ++ 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 711e39a8b07..ae8cad32240 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2011-12-22 John David Anglin + + PR middle-end/51252 + * config/pa/pa.c (pa_som_tm_clone_table_section): New function. + (som_tm_clone_table_section): Declare. + (pa_file_start_space): Create $TM_CLONE_TABLE$ subspace. + (pa_som_asm_init_sections): Init som_tm_clone_table_section. + * config/pa/som.h (TARGET_ASM_TM_CLONE_TABLE_SECTION): Define. + 2011-12-22 Richard Sandiford * doc/tm.texi.in (TARGET_PREPARE_PCH_SAVE): New hook. diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 134f1f88be8..9b1a6578201 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -118,6 +118,7 @@ static int pa_adjust_cost (rtx, rtx, rtx, int); static int pa_adjust_priority (rtx, int); static int pa_issue_rate (void); static void pa_som_asm_init_sections (void) ATTRIBUTE_UNUSED; +static section *pa_som_tm_clone_table_section (void) ATTRIBUTE_UNUSED; static section *pa_select_section (tree, int, unsigned HOST_WIDE_INT) ATTRIBUTE_UNUSED; static void pa_encode_section_info (tree, rtx, int); @@ -192,6 +193,7 @@ static bool pa_legitimate_constant_p (enum machine_mode, rtx); static GTY(()) section *som_readonly_data_section; static GTY(()) section *som_one_only_readonly_data_section; static GTY(()) section *som_one_only_data_section; +static GTY(()) section *som_tm_clone_table_section; /* Counts for the number of callee-saved general and floating point registers which were saved by the current function's prologue. */ @@ -5396,13 +5398,15 @@ pa_file_start_space (int sortspace) aputs ("\t.SPACE $PRIVATE$"); if (sortspace) aputs (",SORT=16"); - aputs ("\n\t.SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31" - "\n\t.SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82" - "\n\t.SPACE $TEXT$"); + aputs ("\n\t.SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31"); + if (flag_tm) + aputs ("\n\t.SUBSPA $TM_CLONE_TABLE$,QUAD=1,ALIGN=8,ACCESS=31"); + aputs ("\n\t.SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82" + "\n\t.SPACE $TEXT$"); if (sortspace) aputs (",SORT=8"); aputs ("\n\t.SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44" - "\n\t.SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY\n"); + "\n\t.SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY\n"); } static inline void @@ -9755,6 +9759,11 @@ pa_som_asm_init_sections (void) "\t.NSUBSPA $DATA$,QUAD=1,ALIGN=8," "ACCESS=31,SORT=24,COMDAT"); + if (flag_tm) + som_tm_clone_table_section + = get_unnamed_section (0, output_section_asm_op, + "\t.SPACE $PRIVATE$\n\t.SUBSPA $TM_CLONE_TABLE$"); + /* FIXME: HPUX ld generates incorrect GOT entries for "T" fixups which reference data within the $TEXT$ space (for example constant strings in the $LIT$ subspace). @@ -9777,6 +9786,14 @@ pa_som_asm_init_sections (void) exception_section = data_section; } +/* Implement TARGET_ASM_TM_CLONE_TABLE_SECTION. */ + +static section * +pa_som_tm_clone_table_section (void) +{ + return som_tm_clone_table_section; +} + /* On hpux10, the linker will give an error if we have a reference in the read-only data section to a symbol defined in a shared library. Therefore, expressions that might require a reloc can diff --git a/gcc/config/pa/som.h b/gcc/config/pa/som.h index 51476157fca..78ee28af630 100644 --- a/gcc/config/pa/som.h +++ b/gcc/config/pa/som.h @@ -342,3 +342,5 @@ do { \ #define SHLIB_SUFFIX ".sl" #define TARGET_HAVE_NAMED_SECTIONS false + +#define TARGET_ASM_TM_CLONE_TABLE_SECTION pa_som_tm_clone_table_section -- 2.30.2