This is the mail archive of the 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]

Re: Question about SUBREG handling in get_last_value

> On Tue, Nov 27, 2001 at 01:32:37PM -0500, John David Anglin wrote:
> > Should get_last_value not call gen_lowpart_for_combine when the
> > last value is VOIDmode or does gen_lowpart_for_combine need fixing
> > so it doesn't call simplify_gen_subreg with innermode=VOIDmode?
> The only VOIDmode that gen_lowpart expects to handle is CONST_INT.
> We almost certainly shouldn't have recorded a get_last_value for
> a call insn; it's not useful.

This wss my initial attempt to fix the problem:

2001-11-27  John David Anglin  <>

	* combine.c (gen_lowpart_for_combine): Don't call simplify_gen_subreg
	with a VOIDmode inner mode.

--- combine.c	Mon Nov 26 17:34:26 2001
+++	Tue Nov 27 13:40:35 2001
@@ -9739,7 +9739,7 @@
   /* If we couldn't simplify X any other way, just enclose it in a
      SUBREG.  Normally, this SUBREG won't match, but some patterns may
      include an explicit SUBREG or we may simplify it further in combine.  */
-  else
+  else if (GET_MODE (x) != VOIDmode)
       int offset = 0;
       rtx res;
@@ -9748,8 +9748,10 @@
       res = simplify_gen_subreg (mode, x, GET_MODE (x), offset);
       if (res)
 	return res;
-      return gen_rtx_CLOBBER (GET_MODE (x), const0_rtx);
+      return gen_rtx_CLOBBER (mode, const0_rtx);
+  else
+    return gen_rtx_CLOBBER (mode, const0_rtx);
 /* These routines make binary and unary operations by first seeing if they

It sound like you would prefer a solution which doesn't record values
which aren't useful.  I presume some mod is needed to get_last_value_validate.
However, how to decide what is useful and what isn't?

J. David Anglin                        
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

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