aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Tietz <ktietz@redhat.com>2014-06-23 23:52:31 +0200
committerKai Tietz <ktietz@gcc.gnu.org>2014-06-23 23:52:31 +0200
commit47c80ef5ab8fe002c4166b9e77ab945dd35be841 (patch)
tree27a570c7008aafb5336eab029fece919f57bb6eb
parent9b7a5864abed3d317b8e4b0a37b3998848e7c81b (diff)
downloadgcc-47c80ef5ab8fe002c4166b9e77ab945dd35be841.zip
gcc-47c80ef5ab8fe002c4166b9e77ab945dd35be841.tar.gz
gcc-47c80ef5ab8fe002c4166b9e77ab945dd35be841.tar.bz2
re PR middle-end/39284 (Computed gotos combined too aggressively)
PR target/39284 * passes.def (peephole2): Move peephole2 pass before before sched2 pass. * config/i386/i386.md (peehole2): Combine memories and indirect jumps. From-SVN: r211919
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/i386/i386.md9
-rw-r--r--gcc/passes.def9
3 files changed, 25 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index df29feb..7d7bd25 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2014-06-23 Kai Tietz <ktietz@redhat.com>
+
+ PR target/39284
+ * passes.def (peephole2): Move peephole2 pass before
+ before sched2 pass.
+ * config/i386/i386.md (peehole2): Combine memories
+ and indirect jumps.
+
2014-06-23 Richard Biener <rguenther@suse.de>
* tree-ssa-loop.c (gate_loop): New function.
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 44c7a0a..695b981 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -11466,6 +11466,15 @@
(match_dup 4)))
(unspec [(const_int 0)] UNSPEC_PEEPSIB)])])
+;; Combining simple memory jump instruction
+
+(define_peephole2
+ [(set (match_operand:W 0 "register_operand")
+ (match_operand:W 1 "memory_operand"))
+ (set (pc) (match_dup 0))]
+ "!TARGET_X32 && peep2_reg_dead_p (2, operands[0])"
+ [(set (pc) (match_dup 1))])
+
;; Call subroutine, returning value in operand 0
(define_expand "call_value"
diff --git a/gcc/passes.def b/gcc/passes.def
index c574b4e..729be9c 100644
--- a/gcc/passes.def
+++ b/gcc/passes.def
@@ -394,13 +394,20 @@ along with GCC; see the file COPYING3. If not see
NEXT_PASS (pass_rtl_dse2);
NEXT_PASS (pass_stack_adjustments);
NEXT_PASS (pass_jump2);
- NEXT_PASS (pass_peephole2);
NEXT_PASS (pass_if_after_reload);
NEXT_PASS (pass_regrename);
NEXT_PASS (pass_cprop_hardreg);
NEXT_PASS (pass_fast_rtl_dce);
NEXT_PASS (pass_duplicate_computed_gotos);
NEXT_PASS (pass_reorder_blocks);
+ /* We need to run peephole2 pass after the duplicate-
+ compute-gotos and the reorder-blocks pass (PR/39284).
+ We have a single indirect branch in the entire function
+ before duplicate-compute-gotos pass. This vastly reduces
+ the size of the CFG.
+ For preventing to run peephole2 pass twice, its run after
+ the jump2 got removed. */
+ NEXT_PASS (pass_peephole2);
NEXT_PASS (pass_branch_target_load_optimize2);
NEXT_PASS (pass_leaf_regs);
NEXT_PASS (pass_split_before_sched2);