[backport from gcc-4.8/trunk r190318 ] Date: Sat, 11 Aug 2012 18:53:10 +0200 From: Bernd Schmidt Subject: Re: Reload/i386 patch for secondary memory vs subregs List-Archive: 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 gcc/ 2012-08-11 Bernd Schmidt * reload1.c (replaced_subreg, gen_reload): Add SECONDARY_MEMORY_NEEDED ifdefs as necessary. --- gcc-4.6.3/gcc/reload1.c.~1~ 2012-08-12 10:58:41.000000000 +0200 +++ gcc-4.6.3/gcc/reload1.c 2012-08-12 10:59:29.000000000 +0200 @@ -8400,6 +8400,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. */ @@ -8411,6 +8412,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 @@ -8422,7 +8424,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. */