aboutsummaryrefslogtreecommitdiff
path: root/gcc/cse.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2012-06-15 09:22:00 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2012-06-15 09:22:00 +0000
commit2da02156af964dbd197f19cbd7fea003a73aacb3 (patch)
tree25c62c51c178ea6a10880eb537b869fdb857970d /gcc/cse.c
parent6724292e72a9bdbafb0d95587740378f36036707 (diff)
downloadgcc-2da02156af964dbd197f19cbd7fea003a73aacb3.zip
gcc-2da02156af964dbd197f19cbd7fea003a73aacb3.tar.gz
gcc-2da02156af964dbd197f19cbd7fea003a73aacb3.tar.bz2
re PR middle-end/53590 (compiler fails to generate SIMD instruction for FP division)
PR middle-end/53590 * common.opt (-fdelete-dead-exceptions): New switch. * doc/invoke.texi (Code Gen Options): Document it. * cse.c (count_reg_usage) <CALL_INSN>: Use !insn_nothrow_p in lieu of insn_could_throw_p predicate. Do not skip an insn that could throw if dead exceptions can be deleted. (insn_live_p): Likewise, do not return true in that case. * dce.c (can_alter_cfg): New flag. (deletable_insn_p): Do not return false for an insn that can throw if the CFG can be altered and dead exceptions can be deleted. (init_dce): Set can_alter_cfg to false for fast DCE, true otherwise. * dse.c (scan_insn): Use !insn_nothrow_p in lieu of insn_could_throw_ predicate. Do not preserve an insn that could throw if dead exceptions can be deleted. * function.h (struct function): Add can_delete_dead_exceptions flag. * function.c (allocate_struct_function): Set it. * lto-streamer-in.c (input_struct_function_base): Stream it. * lto-streamer-out.c (input_struct_function_base): Likewise. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Do not mark a statement that could throw as necessary if dead exceptions can be deleted. ada/ * gcc-interface/misc.c (gnat_init_options_struct): Set opts->x_flag_delete_dead_exceptions to 1. From-SVN: r188651
Diffstat (limited to 'gcc/cse.c')
-rw-r--r--gcc/cse.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index 783c932..9d5e32e 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -599,7 +599,6 @@ static void invalidate_from_clobbers (rtx);
static void invalidate_from_sets_and_clobbers (rtx);
static rtx cse_process_notes (rtx, rtx, bool *);
static void cse_extended_basic_block (struct cse_basic_block_data *);
-static void count_reg_usage (rtx, int *, rtx, int);
static int check_for_label_ref (rtx *, void *);
extern void dump_class (struct table_elt*);
static void get_cse_reg_info_1 (unsigned int regno);
@@ -6692,10 +6691,11 @@ count_reg_usage (rtx x, int *counts, rtx dest, int incr)
case CALL_INSN:
case INSN:
case JUMP_INSN:
- /* We expect dest to be NULL_RTX here. If the insn may trap,
+ /* We expect dest to be NULL_RTX here. If the insn may throw,
or if it cannot be deleted due to side-effects, mark this fact
by setting DEST to pc_rtx. */
- if (insn_could_throw_p (x) || side_effects_p (PATTERN (x)))
+ if ((!cfun->can_delete_dead_exceptions && !insn_nothrow_p (x))
+ || side_effects_p (PATTERN (x)))
dest = pc_rtx;
if (code == CALL_INSN)
count_reg_usage (CALL_INSN_FUNCTION_USAGE (x), counts, dest, incr);
@@ -6800,7 +6800,7 @@ static bool
insn_live_p (rtx insn, int *counts)
{
int i;
- if (insn_could_throw_p (insn))
+ if (!cfun->can_delete_dead_exceptions && !insn_nothrow_p (insn))
return true;
else if (GET_CODE (PATTERN (insn)) == SET)
return set_live_p (PATTERN (insn), insn, counts);