This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix propagate_for_debug


Hi!

In 4.4 VTA backport on a large testcase I couldn't reduce much we ICE
because propagate_for_debug substitutes (const_int 1) for subreg in
(zero_extend:DI (subreg:SI (...))), so we end up with invalid
(zero_extend:DI (const_int 1)).
propagate_for_debug_subst tries to avoid this happening for SUBREGs by
special casing them, but even if we handled ZERO_EXTEND/SIGN_EXTEND, there
can be other types of expressions that have similar issues (e.g. when
substituting both sides of a comparison, ...).
The following patch fixes it by wrapping constants, simplify-rtx.c
afterwards is able to deal with the extra CONSTs (at least in
simplify_unary_operation).

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2009-09-11  Jakub Jelinek  <jakub@redhat.com>

	* combine.c (propagate_for_debug_subst): Call wrap_constant on top.

--- gcc/combine.c.jj	2009-09-08 12:32:31.000000000 +0200
+++ gcc/combine.c	2009-09-11 11:01:32.000000000 +0200
@@ -2311,7 +2311,7 @@ propagate_for_debug_subst (rtx *loc, voi
 	  to = simplify_gen_subreg (GET_MODE (x), to,
 				    GET_MODE (from), SUBREG_BYTE (x));
 	}
-      *loc = to;
+      *loc = wrap_constant (GET_MODE (x), to);
       pair->changed = true;
       return -1;
     }

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]