public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, ARM] Fix PR44557, Thumb-1 ICE
@ 2010-12-09 10:23 Chung-Lin Tang
  2010-12-20 19:26 ` Richard Earnshaw
       [not found] ` <1292868188.24737.28.camel@e102346-lin.cambridge.arm.com>
  0 siblings, 2 replies; 6+ messages in thread
From: Chung-Lin Tang @ 2010-12-09 10:23 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 608 bytes --]

Hi,
this patch fixes the ICE in PR44557. It now occurs on trunk only under 
quite specific option conditions, but debugging this PR leaded to quite 
obvious Thumb-1 fixes.

Also added a simplified testcase, derived from the one on bugzilla. 
Tested without regressions, okay to commit to trunk?

Thanks,
Chung-Lin

2010-12-09  Chung-Lin Tang  <cltang@codesourcery.com>

	PR target/44557
	* config/arm/arm.h (PREFERRED_RELOAD_CLASS): Add CORE_REGS to
	Thumb-1 return LO_REGS case.
	* config/arm/arm.md (reload_inhi): Change scratch constraint
	from 'r' to 'l'.

	testsuite/
	* gcc.target/arm/pr44557.c: New.


[-- Attachment #2: pr44557.patch --]
[-- Type: text/plain, Size: 1654 bytes --]

Index: gcc/config/arm/arm.h
===================================================================
--- gcc/config/arm/arm.h	(revision 167626)
+++ gcc/config/arm/arm.h	(working copy)
@@ -1207,6 +1207,7 @@
   (TARGET_32BIT ? (CLASS) :				\
    ((CLASS) == GENERAL_REGS || (CLASS) == HI_REGS	\
     || (CLASS) == NO_REGS || (CLASS) == STACK_REG	\
+    || (CLASS) == CORE_REGS				\
    ? LO_REGS : (CLASS)))
 
 /* Must leave BASE_REGS reloads alone */
Index: gcc/config/arm/arm.md
===================================================================
--- gcc/config/arm/arm.md	(revision 167626)
+++ gcc/config/arm/arm.md	(working copy)
@@ -5850,7 +5850,7 @@
 (define_expand "reload_inhi"
   [(parallel [(match_operand:HI 0 "s_register_operand" "=r")
 	      (match_operand:HI 1 "arm_reload_memory_operand" "o")
-	      (match_operand:DI 2 "s_register_operand" "=&r")])]
+	      (match_operand:DI 2 "s_register_operand" "=&l")])]
   "TARGET_EITHER"
   "
   if (TARGET_ARM)
Index: gcc/testsuite/gcc.target/arm/pr44557.c
===================================================================
--- gcc/testsuite/gcc.target/arm/pr44557.c	(revision 0)
+++ gcc/testsuite/gcc.target/arm/pr44557.c	(revision 0)
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-mthumb -O1 -march=armv5te -fno-omit-frame-pointer -fno-forward-propagate" }  */
+/* { dg-require-effective-target arm_thumb1_ok } */
+
+struct S
+{
+  short x, y;
+};
+
+void foo (struct S *p, struct S *q, char *t, int n)
+{
+  struct S *c, d;
+  int x = 1;
+
+  while (n--)
+    {
+      if (*t && p)
+	c = p;
+      q->x = d.x + c->x + c->y;
+      if (x)
+	{
+	  x = 0;
+	  d.x += c->x;
+	}
+    }
+}

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-03-15  1:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-09 10:23 [PATCH, ARM] Fix PR44557, Thumb-1 ICE Chung-Lin Tang
2010-12-20 19:26 ` Richard Earnshaw
     [not found] ` <1292868188.24737.28.camel@e102346-lin.cambridge.arm.com>
2011-01-01 11:21   ` Chung-Lin Tang
2011-01-26  3:46     ` Ping " Chung-Lin Tang
2011-03-07 14:11       ` Chung-Lin Tang
2011-03-15  1:40         ` Ping^3 " Chung-Lin Tang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).