This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR target/27571: ICE in get_attr_usegp, at config/alpha/alpha.md:171
- From: Falk Hueffner <falk at debian dot org>
- To: gcc-patches at gcc dot gnu dot org
- Cc: rth at redhat dot com, tbm at cyrius dot com
- Date: Thu, 25 May 2006 17:23:00 +0200
- Subject: [PATCH] Fix PR target/27571: ICE in get_attr_usegp, at config/alpha/alpha.md:171
Hi,
this patch suggested by Steven Bosscher fixes the problem by skipping
jump table data "insns" when looking for insns that need the gp.
Tested on alphaev68-linux with c,c++,fortran,java,objc.
Falk
2006-05-24 Steven Bosscher <steven@gcc.gnu.org>
PR target/27571
* config/alpha/alpha.c (alpha_does_function_need_gp): Skip jump
table data.
2006-05-24 Falk Hueffner <falk@debian.org>
* gcc.c-torture/compile/pr27571.c: New test.
Index: gcc/config/alpha/alpha.c
===================================================================
--- gcc/config/alpha/alpha.c (revision 113950)
+++ gcc/config/alpha/alpha.c (working copy)
@@ -7410,6 +7410,7 @@
for (; insn; insn = NEXT_INSN (insn))
if (INSN_P (insn)
+ && ! JUMP_TABLE_DATA_P (insn)
&& GET_CODE (PATTERN (insn)) != USE
&& GET_CODE (PATTERN (insn)) != CLOBBER
&& get_attr_usegp (insn))
Index: gcc/testsuite/gcc.c-torture/compile/pr27571.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/pr27571.c (revision 0)
+++ gcc/testsuite/gcc.c-torture/compile/pr27571.c (revision 0)
@@ -0,0 +1,27 @@
+/* PR target/27571
+ alpha_does_function_need_gp did not properly skip jump table insns */
+
+int r3isseparator(int);
+void r3isdigit(int);
+void r3decimalvalue(int);
+
+void r7todouble(int *storage, int *count) {
+ int i = 0;
+ int state = 0;
+ int cc = 0;
+ while (i > *count) {
+ cc = *storage;
+ switch (state) {
+ case 0:
+ if (r3isseparator(cc))
+ state = 1;
+ case 1:
+ r3isdigit(cc);
+ case 2:
+ case 5:
+ case 6:
+ r3decimalvalue(cc);
+ }
+ i++;
+ }
+}