This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Avoid unneeded TREE_CONSTANT_POOL_ADDRESS_P test
- From: Roger Sayle <roger at eyesopen dot com>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 1 Jun 2003 15:49:28 -0600 (MDT)
- Subject: [PATCH] Avoid unneeded TREE_CONSTANT_POOL_ADDRESS_P test
On Sun, 1 Jun 2003, Zack Weinberg wrote:
> This is the right general idea, but...
> this check is wrong; the TREE_CONSTANT_POOL_ADDRESS_P flag is
> private to varasm.c. Anyhow, you don't need to look at it.
Hi Zack,
Many thanks. I wasn't sure whether the test was strictly needed
or not, and the use of TREE_CONSTANT_POOL_ADDRESS_P in integrate.c
seemed to hint that it wasn't completely private to varasm.c.
Unfortunately, I've already committed the modified version of
my original patch to mainline CVS upon Geoff Keating's approval.
However, the patch below implements your suggestion to improve
the code that was committed.
The following patch has been bootstrapped 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?
2003-06-01 Roger Sayle <roger@eyesopen.com>
Zack Weinberg <zack@codesourcery.com>
* emit-rtl.c (gen_complex_constant_part): Remove unnecessary
test of TREE_CONSTANT_POOL_ADDRESS_P.
Index: emit-rtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/emit-rtl.c,v
retrieving revision 1.327
diff -c -3 -p -r1.327 emit-rtl.c
*** emit-rtl.c 30 May 2003 21:41:21 -0000 1.327
--- emit-rtl.c 1 Jun 2003 18:22:53 -0000
*************** gen_complex_constant_part (mode, x, imag
*** 1310,1317 ****
tree decl, part;
if (GET_CODE (x) == MEM
! && GET_CODE (XEXP (x, 0)) == SYMBOL_REF
! && TREE_CONSTANT_POOL_ADDRESS_P (XEXP (x, 0)))
{
decl = SYMBOL_REF_DECL (XEXP (x, 0));
if (decl != NULL_TREE && TREE_CODE (decl) == COMPLEX_CST)
--- 1310,1316 ----
tree decl, part;
if (GET_CODE (x) == MEM
! && GET_CODE (XEXP (x, 0)) == SYMBOL_REF)
{
decl = SYMBOL_REF_DECL (XEXP (x, 0));
if (decl != NULL_TREE && TREE_CODE (decl) == COMPLEX_CST)
Roger
--
Roger Sayle, E-mail: roger@eyesopen.com
OpenEye Scientific Software, WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road, Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507. Fax: (+1) 505-473-0833