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: [PATCH] Handle (subreg (const_double ...)) in subst.


Roger Sayle <roger@eyesopen.com> writes:

> The following patch fixes a latent bug uncovered by my RTL optimization
> unification experiments.  combine.c's subst can potentially substitute a
> CONST_DOUBLE into a SUBREG, which is invalid as the CONST_DOUBLE doesn't
> have a mode.  The solution its to "simplify" the problematic subreg
> immediately after the substitution whilst we still have the original
> inner mode, as we already do for CONST_INT.
> 
> The testcase is gcc.c-torture/execute/20000412-5.c, but this problem
> is curently masked as mainline doesn't examine the bad RTX, other than
> passing it to recog with fails harmlessly.  Other parts of the compiler
> are less forgiving :>
> 
> 
> The following patch has been tested on i686-pc-linux-gnu with a full
> "make bootstrap", all languages except treelang, and regression tested
> with a top-level "make -k check" with no new failures.
> 
> Ok for mainline?

CONST_DOUBLEs can have floating-point modes, but I think this is still
right, because you don't want to be creating SUBREGs of them either.
This is OK.

> 2003-07-16  Roger Sayle  <roger@eyesopen.com>
> 
> 	* combine.c (subst): Also handle (subreg (const_double ...)) case
> 	if created by a substitution, by using the original inner mode.
-- 
- Geoffrey Keating <geoffk@geoffk.org>


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