This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Reload/i386 patch for secondary memory vs subregs
- From: Bernd Schmidt <bernds at codesourcery dot com>
- To: John David Anglin <dave dot anglin at nrc-cnrc dot gc dot ca>
- Cc: John David Anglin <dave at hiauly1 dot hia dot nrc dot ca>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 11 Aug 2012 18:53:10 +0200
- Subject: Re: Reload/i386 patch for secondary memory vs subregs
- References: <501BE12F.2000205@codesourcery.com> <20120811142012.GA16383@hiauly1.hia.nrc.ca>
On 08/11/2012 04:20 PM, John David Anglin wrote:
>> * reload1.c (replaced_subreg): New static function.
>> (gen_reload): Use it when deciding whether to use secondary
>> memory.
>
> This causes the following on hppa*-*-* (32-bit):
>
> ../../gcc/gcc/reload1.c: In function 'rtx_def* gen_reload(rtx, rtx, int, reload_
> type)':
> ../../gcc/gcc/reload1.c:8494:12: error: unused variable 'tem1' [-Werror=unused-v
> ariable]
> rtx tem, tem1, tem2;
> ^
> ../../gcc/gcc/reload1.c:8494:18: error: unused variable 'tem2' [-Werror=unused-variable]
> rtx tem, tem1, tem2;
> ^
> ../../gcc/gcc/reload1.c: At global scope:
> ../../gcc/gcc/reload1.c:8477:1: error: 'rtx_def* replaced_subreg(rtx)' defined but not used [-Werror=unused-function]
> replaced_subreg (rtx x)
> ^
> cc1plus: all warnings being treated as errors
> make[3]: *** [reload1.o] Error 1
Fixed.
Bernd
Index: gcc/ChangeLog
===================================================================
--- gcc/ChangeLog (revision 190317)
+++ gcc/ChangeLog (working copy)
@@ -1,3 +1,8 @@
+2012-08-11 Bernd Schmidt <bernds@codesourcery.com>
+
+ * reload1.c (replaced_subreg, gen_reload): Add
+ SECONDARY_MEMORY_NEEDED ifdefs as necessary.
+
2012-08-11 Jan Hubicka <jh@suse.cz>
* lto-section-in.c (lto_section_name): Do not use "symtab" as part of
Index: gcc/reload1.c
===================================================================
--- gcc/reload1.c (revision 190252)
+++ gcc/reload1.c (working copy)
@@ -8469,6 +8469,7 @@ emit_insn_if_valid_for_reload (rtx insn)
return NULL;
}
+#ifdef SECONDARY_MEMORY_NEEDED
/* If X is not a subreg, return it unmodified. If it is a subreg,
look up whether we made a replacement for the SUBREG_REG. Return
either the replacement or the SUBREG_REG. */
@@ -8480,6 +8481,7 @@ replaced_subreg (rtx x)
return find_replacement (&SUBREG_REG (x));
return x;
}
+#endif
/* Emit code to perform a reload from IN (which may be a reload register) to
OUT (which may also be a reload register). IN or OUT is from operand
@@ -8491,7 +8493,10 @@ static rtx
gen_reload (rtx out, rtx in, int opnum, enum reload_type type)
{
rtx last = get_last_insn ();
- rtx tem, tem1, tem2;
+ rtx tem;
+#ifdef SECONDARY_MEMORY_NEEDED
+ rtx tem1, tem2;
+#endif
/* If IN is a paradoxical SUBREG, remove it and try to put the
opposite SUBREG on OUT. Likewise for a paradoxical SUBREG on OUT. */