Bug 46434 - crx-elf --enable-werror-always build fails
Summary: crx-elf --enable-werror-always build fails
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: build, patch
Depends on:
Blocks: enable-werror-always
  Show dependency treegraph
 
Reported: 2010-11-11 13:14 UTC by Jorn Wolfgang Rennecke
Modified: 2010-11-22 22:05 UTC (History)
0 users

See Also:
Host:
Target: crx-elf
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jorn Wolfgang Rennecke 2010-11-11 13:14:53 UTC
../../../gcc/gcc/config/crx/crx.c: In function ‘crx_addr_reg_p’:
../../../gcc/gcc/config/crx/crx.c:595:7: error: variable ‘reg’ set but not used [-Werror=unused-but-set-variable]
../../../gcc/gcc/config/crx/crx.c: In function ‘crx_expand_epilogue’:
../../../gcc/gcc/config/crx/crx.c:1442:7: error: variable ‘return_reg’ set but n
Comment 1 Jorn Wolfgang Rennecke 2010-11-15 14:17:30 UTC
A patch has been posted here:
http://gcc.gnu.org/ml/gcc-patches/2010-11/msg01303.html
Comment 2 Jorn Wolfgang Rennecke 2010-11-19 19:22:31 UTC
Author: amylaar
Date: Fri Nov 19 19:22:27 2010
New Revision: 166954

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=166954
Log:
	PR target/46434
	* config/crx/crx.c (crx_expand_epilogue): Remove unused variable.
Index: config/crx/crx.c
===================================================================
--- config/crx/crx.c	(revision 166609)
+++ config/crx/crx.c	(working copy)
@@ -613,6 +613,8 @@ static int crx_addr_reg_p (rtx addr_reg)
       return FALSE;
     }
 
+  gcc_assert (REGNO (reg) != CC_REGNUM);
+
   return TRUE;
 }
 
@@ -1439,17 +1441,12 @@ crx_expand_prologue (void)
 void
 crx_expand_epilogue (void)
 {
-  rtx return_reg;
-
   /* Nonzero if we need to return and pop only RA. This will generate a
    * different insn. This differentiate is for the peepholes for call as last
    * statement in function. */
   int only_popret_RA = (save_regs[RETURN_ADDRESS_REGNUM]
 			&& (sum_regs == UNITS_PER_WORD));
 
-  /* Return register.  */
-  return_reg = gen_rtx_REG (Pmode, RETURN_ADDRESS_REGNUM);
-
   if (frame_pointer_needed)
     /* Restore the stack pointer with the frame pointers value */
     emit_move_insn (stack_pointer_rtx, frame_pointer_rtx);

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/crx/crx.c
Comment 3 Richard Henderson 2010-11-22 21:20:58 UTC
Author: rth
Date: Mon Nov 22 21:20:52 2010
New Revision: 167053

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167053
Log:
PR target/46434
        * config/crx/crx.c (crx_addr_reg): Rename from crx_addr_reg_p;
        return the address register extracted.
        (crx_decompose_address): Update the extracted address register.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/crx/crx.c
Comment 4 Jorn Wolfgang Rennecke 2010-11-22 22:05:18 UTC
Patches have been applied to trunk.