diff mbox

[v3] bb-reorder: Improve compgotos pass (PR71785)

Message ID 87r3671b0x.fsf@linux-m68k.org
State New
Headers show

Commit Message

Andreas Schwab Nov. 19, 2016, 8:15 p.m. UTC
On Nov 17 2016, Segher Boessenkool <segher@kernel.crashing.org> wrote:

> 	PR rtl-optimization/71785
> 	* bb-reorder.c (maybe_duplicate_computed_goto): New function.
> 	(duplicate_computed_gotos): New function.
> 	(pass_duplicate_computed_gotos::execute): Rewrite.

This breaks gcc.c-torture/execute/comp-goto-1.c execution test with -O2
-flto on ia64 and m68k.  The label sim_base_addr has been placed after
the L_LOAD32_RR and L_METAOP_DONE labels, so that
op_map[program[i].f1.offset] - base_addr becomes negative.  That can be
fixed by making .offset a signed bitfield.  Installed as obvious.

Andreas.

	* gcc.c-torture/execute/comp-goto-1.c (insn_t): Change offset to
	signed int.
diff mbox

Patch

diff --git a/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c b/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c
index 3bf9a26f65..4c41b71c34 100644
--- a/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c
@@ -14,7 +14,7 @@  typedef union
 {
   struct
     {
-      unsigned int	offset:18;
+      signed int	offset:18;
       unsigned int	ignore:4;
       unsigned int	s1:8;
       int		:2;