aboutsummaryrefslogtreecommitdiff
path: root/gcc/opts.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-08-07 08:23:42 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2009-08-07 08:23:42 +0200
commit17f6e37dc188165f634dbb606ecb23892bf2e125 (patch)
treebe903d41bba7e532d63c4989541b151675fc4f7d /gcc/opts.c
parent3f84bf08c48ea4e037a74f1122c6420ce557518d (diff)
downloadgcc-17f6e37dc188165f634dbb606ecb23892bf2e125.zip
gcc-17f6e37dc188165f634dbb606ecb23892bf2e125.tar.gz
gcc-17f6e37dc188165f634dbb606ecb23892bf2e125.tar.bz2
dwarf2out.c (output_fde): When doing hot/cold partitioning...
* dwarf2out.c (output_fde): When doing hot/cold partitioning, use fde->dw_fde_begin as begin label instead of hot/cold label. Use LLSDAC label instead of LLSDA for second section lsda. (dwarf2out_do_cfi_startproc): Add SECOND argument. Use LLSDAC label instead of LLSDA if it is true. (dwarf2out_begin_prologue, dwarf2out_switch_text_section): Adjust callers. * except.c (add_call_site, dw2_size_of_call_site_table): Add SECTION argument. Use it as index into crtl->eh.call_site_record array. (dw2_output_call_site_table): Likewise. Add CS_FORMAT argument, use it to determine how to print table entries instead of using #ifdef HAVE_AS_LEB128. For SECTION > 0 use hot resp. cold label instead of normal begin label as base. (sjlj_assign_call_site_values): Adjust add_call_site caller. (convert_to_eh_region_ranges): When doing hot/cold partitioning, ensure no EH range spans between sections and that landing pads are always in the corresponding section. (sjlj_size_of_call_site_table, sjlj_output_call_site_table): Adjust for crtl->eh.call_site_record being an array rather than scalar. (output_one_function_exception_table): New function, copied from output_function_exception_table. Adjust dw2_size_of_call_site_table, dw2_output_call_site_table callers. For SECOND section use *C suffixed labels. (output_function_exception_table): Call output_one_function_exception_table and, when doing hot/cold partitioning, also another time for the second section. * opts.c: Include except.h. (decode_options): Allow -freorder-blocks-and-partition with exceptions, unless SJLJ or TARGET_UNWIND_INFO. * Makefile.in (opts.o): Depend on $(EXCEPT_H). * function.h (struct rtl_eh): Change call_site_record from scalar into array of 2 elements. * g++.dg/tree-prof/partition1.C: New test. From-SVN: r150553
Diffstat (limited to 'gcc/opts.c')
-rw-r--r--gcc/opts.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/gcc/opts.c b/gcc/opts.c
index 33635dd..59c24b6 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -43,6 +43,7 @@ along with GCC; see the file COPYING3. If not see
#include "dbgcnt.h"
#include "debug.h"
#include "plugin.h"
+#include "except.h"
/* Value of the -G xx switch, and whether it was passed or not. */
unsigned HOST_WIDE_INT g_switch_value;
@@ -1036,10 +1037,15 @@ decode_options (unsigned int argc, const char **argv)
generating unwind info. If flag_exceptions is turned on we need to
turn off the partitioning optimization. */
- if (flag_exceptions && flag_reorder_blocks_and_partition)
+ if (flag_exceptions && flag_reorder_blocks_and_partition
+ && (USING_SJLJ_EXCEPTIONS
+#ifdef TARGET_UNWIND_INFO
+ || 1
+#endif
+ ))
{
inform (input_location,
- "-freorder-blocks-and-partition does not work with exceptions");
+ "-freorder-blocks-and-partition does not work with exceptions on this architecture");
flag_reorder_blocks_and_partition = 0;
flag_reorder_blocks = 1;
}
@@ -1048,9 +1054,15 @@ decode_options (unsigned int argc, const char **argv)
optimization. */
if (flag_unwind_tables && ! targetm.unwind_tables_default
- && flag_reorder_blocks_and_partition)
+ && flag_reorder_blocks_and_partition
+ && (USING_SJLJ_EXCEPTIONS
+#ifdef TARGET_UNWIND_INFO
+ || 1
+#endif
+ ))
{
- inform (input_location, "-freorder-blocks-and-partition does not support unwind info");
+ inform (input_location,
+ "-freorder-blocks-and-partition does not support unwind info on this architecture");
flag_reorder_blocks_and_partition = 0;
flag_reorder_blocks = 1;
}
@@ -1061,7 +1073,12 @@ decode_options (unsigned int argc, const char **argv)
if (flag_reorder_blocks_and_partition
&& (!targetm.have_named_sections
- || (flag_unwind_tables && targetm.unwind_tables_default)))
+ || (flag_unwind_tables && targetm.unwind_tables_default
+ && (USING_SJLJ_EXCEPTIONS
+#ifdef TARGET_UNWIND_INFO
+ || 1
+#endif
+ ))))
{
inform (input_location,
"-freorder-blocks-and-partition does not work on this architecture");