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]

Re: subreg problem


> Err, yes you can.  The third operand.

Unfortunately, the information as to what the mode should be is not
available.  This is what is available in combine_simplify_rtx:

(gdb) p debug_rtx (x)

(subreg/s/u:SI (const_int 0 [0x0]) 4)
$5 = 1
(gdb) p mode
$6 = SImode
(gdb) p op0_mode
$7 = VOIDmode

The last place where the mode information was available is
simplify_if_then_else at combine.c:4628 where true_rtx is:

(gdb) p debug_rtx (true_rtx)

(subreg/s/u:SI (reg:DI 71) 4)

The code here is

      if (reg_mentioned_p (from, true_rtx))
	true_rtx = subst (known_cond (copy_rtx (true_rtx), true_code,
				      from, true_val),
			  pc_rtx, pc_rtx, 0, 0);

subst doesn't know what the mode of true_rtx is.  This is the trace:

#0  simplify_subreg (outermode=SImode, op=0x800003ffefeb9400, 
    innermode=VOIDmode, byte=4) at ../../gcc/gcc/simplify-rtx.c:2420
#1  0x4000000000301ba0 in combine_simplify_rtx (x=0x800003ffef859160, 
    op0_mode=VOIDmode, last=0, in_dest=0) at ../../gcc/gcc/combine.c:3804
#2  0x4000000000300a58 in subst (x=0x800003ffef859160, 
    from=0x800003ffefec8000, to=0x800003ffefec8000, in_dest=0, unique_copy=0)
    at ../../gcc/gcc/combine.c:3502
#3  0x4000000000304c40 in simplify_if_then_else (x=0x800003ffef856120)
    at ../../gcc/gcc/combine.c:4628
...

Should subst be modified so this information is passed down to it.  I
believe that it currently determines op0_mode here:

      /* Get the mode of operand 0 in case X is now a SIGN_EXTEND of a
	 constant.  */
     if (fmt[0] == 'e')
       op0_mode = GET_MODE (XEXP (x, 0));

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
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]