From 28fe824a713f1a632b8d35a0c5fb36dd0026622c Mon Sep 17 00:00:00 2001 From: rearnsha Date: Fri, 24 Oct 2003 08:47:18 +0000 Subject: [PATCH] * arm.c (note_invalid_constants): Try to extract the constant pool value using avoid_constant_pool_reference; only use get_pool_constant if that returns the original reference. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72883 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/config/arm/arm.c | 20 +++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4b59697..794eb01 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-10-24 Richard Earnshaw + + * arm.c (note_invalid_constants): Try to extract the constant + pool value using avoid_constant_pool_reference; only use + get_pool_constant if that returns the original reference. + 2003-10-24 Jan Hubicka PR c++/12624 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 8a7997e..2b1bf7a 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -6894,9 +6894,23 @@ note_invalid_constants (rtx insn, HOST_WIDE_INT address, int do_pushes) && CONSTANT_POOL_ADDRESS_P (XEXP (op, 0))) { if (do_pushes) - push_minipool_fix (insn, address, recog_data.operand_loc[opno], - recog_data.operand_mode[opno], - get_pool_constant (XEXP (op, 0))); + { + rtx cop = avoid_constant_pool_reference (op); + + /* Casting the address of something to a mode narrower + than a word can cause avoid_constant_pool_reference() + to return the pool reference itself. That's no good to + us here. Lets just hope that we can use the + constant pool value directly. */ + if (op == cop) + op = get_pool_constant (XEXP (op, 0)); + else + op = cop; + + push_minipool_fix (insn, address, + recog_data.operand_loc[opno], + recog_data.operand_mode[opno], op); + } result = true; } -- 2.7.4