This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RFA: RL78: Scan inside PARALLELs when looking for dead code
- From: Nick Clifton <nickc at redhat dot com>
- To: dj at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 20 Jan 2015 13:45:08 +0000
- Subject: RFA: RL78: Scan inside PARALLELs when looking for dead code
- Authentication-results: sourceware.org; auth=none
Hi DJ,
Here is a small patch to fix a code-gen problem for the RL78. The bug
was that the register death pass was not looking inside PARALLELs, and
thus missing some USE and SET cases. I considered adding code to scan
all of the elements in the PARALLEL, but the only ones that can be
generated for the RL78 are the SImode shift patterns and these always
consist of a SET as the first element and a CLOBBER as the second
element. So I decided to keep things simple and create the patch
below.
OK to apply ?
Cheers
Nick
2015-01-20 Nick Clifton <nickc@redhat.com>
* config/rl78/rl78.c (rl78_calculate_death_notes): Look inside
PARALLELs.
Index: gcc/config/rl78/rl78.c
===================================================================
--- gcc/config/rl78/rl78.c (revision 219891)
+++ gcc/config/rl78/rl78.c (working copy)
@@ -3583,6 +3583,8 @@
{
case INSN:
p = PATTERN (insn);
+ if (GET_CODE (p) == PARALLEL)
+ p = XVECEXP (p, 0, 0);
switch (GET_CODE (p))
{
case SET: