This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Handle (subreg (const_double ...)) in subst.
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 16 Jul 2003 11:26:27 -0700
- Subject: Re: [PATCH] Handle (subreg (const_double ...)) in subst.
- References: <Pine.LNX.4.44.0307161036520.17115-100000@www.eyesopen.com>
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>