This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH PR target/47744: [x32] ICE: in reload_cse_simplify_operands, at postreload.c:403


Hi,

I checked in the following testcases for PR target/47744.


H.J.
---
Index: gcc.dg/torture/pr47744-2.c
===================================================================
--- gcc.dg/torture/pr47744-2.c	(revision 0)
+++ gcc.dg/torture/pr47744-2.c	(revision 0)
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int128 } */
+/* { dg-options "-std=gnu99" } */
+
+typedef long unsigned int size_t;
+typedef long int ssize_t;
+typedef ssize_t index_type;
+typedef __int128_t GFC_INTEGER_16;
+typedef struct descriptor_dimension
+{
+  index_type _stride;
+  index_type _lbound;
+  index_type _ubound;
+}
+descriptor_dimension;
+typedef struct { GFC_INTEGER_16 *data; size_t offset; index_type dtype; descriptor_dimension dim[7];} gfc_array_i16;
+void
+matmul_i16 (gfc_array_i16 * const restrict retarray,
+	    gfc_array_i16 * const restrict a,
+	    GFC_INTEGER_16 bbase_yn)
+{
+  GFC_INTEGER_16 * restrict dest;
+  index_type rxstride, rystride;
+  index_type x, y, n, count, xcount;
+  GFC_INTEGER_16 * restrict dest_y;
+  GFC_INTEGER_16 s;
+  const GFC_INTEGER_16 * restrict abase_n;
+  rxstride = ((retarray)->dim[0]._stride);
+  rystride = ((retarray)->dim[1]._stride);
+  xcount = ((a)->dim[0]._ubound + 1 - (a)->dim[0]._lbound);
+  dest = retarray->data;
+  dest_y = &dest[y*rystride];
+  for (x = 0; x < xcount; x++)
+    dest_y[x] += abase_n[x] * bbase_yn;
+  for (x = 0; x < xcount; x++)
+    {
+      for (n = 0; n < count; n++)
+	dest_y[x*rxstride] = (GFC_INTEGER_16) 0;
+    }
+}
Index: gcc.dg/torture/pr47744-3.c
===================================================================
--- gcc.dg/torture/pr47744-3.c	(revision 0)
+++ gcc.dg/torture/pr47744-3.c	(revision 0)
@@ -0,0 +1,74 @@
+/* { dg-do compile } */
+
+typedef union rtunion_def {
+  struct rtx_def *rtx;
+} rtunion;
+typedef struct rtx_def {
+  unsigned short code;
+  rtunion fld[1];
+} *rtx;
+extern rtx recog_operand[];
+extern rtx *recog_operand_loc[];
+extern int reload_n_operands;
+extern void find_dummy_reload (int, int);
+extern int asm_noperands (rtx);
+extern int n_occurrences (char **);
+char operands_match[10][10];
+void find_reloads (rtx insn, int n_alternatives, int commutative)
+{
+  register int i, j;
+  int noperands;
+  char *constraints[10];
+  int address_reloaded[10];
+  int this_alternative[10];
+  char this_alternative_win[10];
+  int this_alternative_matches[10];
+  int this_alternative_number;
+  rtx body = ((insn)->fld[3].rtx);
+  int operand_mode[10];
+  if (body->code == 1)
+    {
+      reload_n_operands = noperands = asm_noperands (body);
+      n_alternatives = n_occurrences (constraints);
+    }
+  for (this_alternative_number = 0;
+       this_alternative_number < n_alternatives;
+       this_alternative_number++)
+    for (i = 0;
+	 i < noperands;
+	 i++)
+      {
+	register char *p = constraints[i];
+	register int win = 0;
+	int badop = 1;
+	int c;
+	register rtx operand = recog_operand[i];
+	int force_reload = 0;
+	this_alternative_win[i] = 0;
+	this_alternative[i] = 1;
+	while (*p && (c = *p++) != ',')
+	  switch (c)
+	    {
+	    case '4':
+	      c -= '0';
+	      this_alternative_matches[i] = c;
+	      if ((c != commutative
+		   || i != commutative + 1)
+		  && operands_match[c][i])
+		win = this_alternative_win[c];
+	      else
+		find_dummy_reload (operand_mode[i], this_alternative[c]);
+	      if (! win || force_reload)
+		for (j = 0; j < i; j++)
+		  if (this_alternative_matches[j]
+		      == this_alternative_matches[i])
+		    badop = 1;
+	      break;
+	    case '<':
+	      if (operand->code == 2
+		  && ! address_reloaded[i]
+		  && operand->fld[0].rtx->code == 3)
+		win = 1;
+	    }
+      }
+}
Index: gcc.dg/torture/pr47744-1.c
===================================================================
--- gcc.dg/torture/pr47744-1.c	(revision 0)
+++ gcc.dg/torture/pr47744-1.c	(revision 0)
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-fpic" { target fpic } } */
+
+typedef int int32_t;
+static const int init_jk[] = {2,3,4,6};
+ int __kernel_rem_pio2(double *x, double *y, int e0, int nx, int prec, const int32_t *ipio2)
+{
+ int32_t jz,jx,jv,jp,jk,carry,n,iq[20],i,j,k,m,q0,ih;
+ double z,fw,f[20],fq[20],q[20];
+ jk = init_jk[prec];
+ jp = jk;
+ jx = nx-1;
+ for (i=0;i<=jk;i++) {
+     for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw;
+ }
+ for(i=0,j=jz,z=q[jz];j>0;i++,j--) {
+     z = q[j-1]+fw;
+ }
+ n = (int32_t) z;
+ return n&7;
+}
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 177270)
+++ ChangeLog	(working copy)
@@ -1,3 +1,10 @@
+2011-08-03  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR target/47744
+	* gcc.dg/torture/pr47744-1.c: New.
+	* gcc.dg/torture/pr47744-2.c: Likewise.
+	* gcc.dg/torture/pr47744-3.c: Likewise.
+
 2011-08-03  Richard Guenther  <rguenther@suse.de>
 
 	PR middle-end/49958


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]