This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][m32c] Fix PR target/33184 reload problem building libstdc++
- From: Rask Ingemann Lambertsen <rask at sygehus dot dk>
- To: gcc-patches at gcc dot gnu dot org
- Cc: dj at redhat dot com
- Date: Sun, 26 Aug 2007 23:23:09 +0200
- Subject: [PATCH][m32c] Fix PR target/33184 reload problem building libstdc++
This patch fixes bug 33184. The problem is that
m32c_eh_return_data_regno() uses up the only two address registers, leaving
reload with no way of storing the registers to the stack. The fix is to use
one (or two for 24-bit addresses) of the data registers instead.
Tthis bug also surfaced briefly while fixing PR 32418
<URL:http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32418#c9>.
I tested C and C++ which is what builds on the m32c. There are no
regressions in the C testsuite. Since the unpatched compiler can't build
libstdc++, I used the results from
<URL:http://gcc.gnu.org/ml/gcc-testresults/2007-08/msg00277.html> as the
basis for comparing the C++ results. The only new failures are a new
testcase (g++.dg/init/new23.C) and testcases which didn't even compile
before. Bug middle-end/32656 makes it impossible to test the patch for chips
with 24-bit addresses.
:ADDPATCH m32c:
2007-08-26 Rask Ingemann Lambertsen <rask@sygehus.dk>
PR target/33184
* config/m32c/m32c.c (m32c_eh_return_data_regno): Leave an address
register for reload.
Index: gcc/config/m32c/m32c.c
===================================================================
--- gcc/config/m32c/m32c.c (revision 127179)
+++ gcc/config/m32c/m32c.c (working copy)
@@ -1127,7 +1127,10 @@ m32c_eh_return_data_regno (int n)
case 0:
return A0_REGNO;
case 1:
- return A1_REGNO;
+ if (TARGET_A16)
+ return R3_REGNO;
+ else
+ return R1_REGNO;
default:
return INVALID_REGNUM;
}
--
Rask Ingemann Lambertsen