diff options
author | ctice <ctice@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-31 14:59:59 +0000 |
---|---|---|
committer | ctice <ctice@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-31 14:59:59 +0000 |
commit | 1897b88152df894079137aba336a65361e09a9c8 (patch) | |
tree | ade60c4c4ed198b0036370e03ebd3a1f64ee4817 /gcc/config | |
parent | d6b5203d8dbe5fffec8c3aea15a308aa64faebd5 (diff) | |
download | gcc-1897b88152df894079137aba336a65361e09a9c8.tar.gz |
Fix problems with hot/cold partitioning optimization.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97322 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/darwin.c | 7 | ||||
-rw-r--r-- | gcc/config/darwin.h | 8 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.c | 2 | ||||
-rw-r--r-- | gcc/config/stormy16/stormy16.c | 2 | ||||
-rw-r--r-- | gcc/config/xtensa/xtensa.c | 9 |
5 files changed, 21 insertions, 7 deletions
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index 6a547384aae..e6f41a22994 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -1016,12 +1016,17 @@ machopic_select_section (tree exp, int reloc, bool weak_p = DECL_P (exp) && DECL_WEAK (exp); static void (* const base_funs[][2])(void) = { { text_section, text_coal_section }, - { text_unlikely_section, text_unlikely_coal_section }, + { unlikely_text_section, text_unlikely_coal_section }, { readonly_data_section, const_coal_section }, { const_data_section, const_data_coal_section }, { data_section, data_coal_section } }; + if (reloc == 0 + && (last_text_section == in_text_unlikely + || last_text_section == in_text_unlikely_coal)) + reloc = 1; + if (TREE_CODE (exp) == FUNCTION_DECL) base_function = base_funs[reloc][weak_p]; else if (decl_readonly_section_1 (exp, reloc, MACHOPIC_INDIRECT)) diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index b26715e26ef..25d1bcade86 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -621,6 +621,10 @@ FUNCTION (void) \ if (asm_out_file) \ fputs ("\t" DIRECTIVE "\n", asm_out_file); \ in_section = SECTION; \ + if ((SECTION == in_text_coal) \ + || (SECTION == in_text_unlikely) \ + || (SECTION == in_text_unlikely_coal)) \ + last_text_section = SECTION; \ } \ } \ @@ -660,10 +664,6 @@ SECTION_FUNCTION (text_coal_section, \ in_text_coal, \ ".section __TEXT,__textcoal_nt,coalesced," \ "pure_instructions", 0) \ -SECTION_FUNCTION (text_unlikely_section, \ - in_text_unlikely, \ - ".section __TEXT,__text_unlikely,coalesced," \ - "pure_instructions", 0) \ SECTION_FUNCTION (text_unlikely_coal_section, \ in_text_unlikely_coal, \ ".section __TEXT,__text_unlikely_coal," \ diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 6823915097a..340a3776958 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -8201,7 +8201,7 @@ sparc_output_deferred_case_vectors (void) return; /* Align to cache line in the function's code section. */ - function_section (current_function_decl); + current_function_section (current_function_decl); align = floor_log2 (FUNCTION_BOUNDARY / BITS_PER_UNIT); if (align > 0) diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c index ec40cd916b2..a15051f9202 100644 --- a/gcc/config/stormy16/stormy16.c +++ b/gcc/config/stormy16/stormy16.c @@ -2074,7 +2074,7 @@ xstormy16_output_addr_vec (FILE *file, rtx label ATTRIBUTE_UNUSED, rtx table) { int vlen, idx; - function_section (current_function_decl); + current_function_section (current_function_decl); vlen = XVECLEN (table, 0); for (idx = 0; idx < vlen; idx++) diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index cdba18c8388..b6084c9c5d2 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -1560,6 +1560,15 @@ override_options (void) /* There's no need for -fPIC (as opposed to -fpic) on Xtensa. */ if (flag_pic > 1) flag_pic = 1; + + /* Hot/cold partitioning does not work on this architecture, because of + constant pools (the load instruction cannot necessarily reach that far). + Therefore disable it on this architecture. */ + if (flag_reorder_blocks_and_partition) + { + flag_reorder_blocks_and_partition = 0; + flag_reorder_blocks = 1; + } } |