re PR target/68538 (ICE in gen_reg_rtx, at emit-rtl.c:1027 when cross-compiling for...
authorJeff Law <law@redhat.com>
Mon, 21 Nov 2016 23:24:13 +0000 (16:24 -0700)
committerJeff Law <law@gcc.gnu.org>
Mon, 21 Nov 2016 23:24:13 +0000 (16:24 -0700)
PR target/68538
* config/cris/cris.md: Don't call copy_to_mode_reg unless
can_create_pseudo_p is true.

        PR target/68538
* gcc.c-torture/compile/pr68538.c: New test.

From-SVN: r242682

gcc/ChangeLog
gcc/config/cris/cris.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr68538.c [new file with mode: 0644]

index 41772a0bdbf92b2cf2b503f8f23665a75d73e125..1f2f8ab4cf1044643431c3f6ad3b0da0e57ea944 100644 (file)
@@ -1,3 +1,9 @@
+2016-11-21  Jeff Law  <law@redhat.com>
+
+       PR target/68538
+       * config/cris/cris.md: Don't call copy_to_mode_reg unless
+       can_create_pseudo_p is true.
+
 2016-11-21  Segher Boessenkool  <segher@kernel.crashing.org>
 
        PR target/68803
index 59a386252c6d68f6e806c3b62f294ea2ab5951a0..13279b538ba3f9c1bb6c89691d9f36eeca5973de 100644 (file)
 {
   if (MEM_P (operands[0])
       && operands[1] != const0_rtx
-      && (!TARGET_V32 || (!REG_P (operands[1]) && can_create_pseudo_p ())))
+      && can_create_pseudo_p ()
+      && (!TARGET_V32 || !REG_P (operands[1])))
     operands[1] = copy_to_mode_reg (DImode, operands[1]);
 
   /* Some other ports (as of 2001-09-10 for example mcore and romp) also
index cef6a27712944d5cc199f8a77d8a3a6f5575c9d3..e707841acce3ea81fd50d7e4373dfceb6530ca49 100644 (file)
@@ -1,3 +1,8 @@
+2016-11-21  Jeff Law  <law@redhat.com>
+
+        PR target/68538
+       * gcc.c-torture/compile/pr68538.c: New test.
+
 2016-11-21  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
        * gcc.target/powerpc/ppc-round2.c: Allow XSCVDPSXWS and XSCVDPUXWS
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr68538.c b/gcc/testsuite/gcc.c-torture/compile/pr68538.c
new file mode 100644 (file)
index 0000000..2822cdb
--- /dev/null
@@ -0,0 +1,52 @@
+struct percpu_counter {
+       signed long long count;
+};
+struct blkg_rwstat {
+       struct percpu_counter cpu_cnt[4];
+};
+struct cfq_group {
+       struct blkg_rwstat service_time;
+};
+struct cfq_queue {
+       struct cfq_group *group;
+};
+struct request {
+       struct cfq_queue *active_queue;
+       unsigned long long cmd_flags;
+       void *priv;
+};
+static void blkg_rwstat_add(struct blkg_rwstat *rwstat, int rw, unsigned long long val)
+{
+       struct percpu_counter *cnt;
+       if (rw & 1)
+               cnt = &rwstat->cpu_cnt[1];
+       else
+               cnt = &rwstat->cpu_cnt[0];
+       cnt->count += val;
+       if (rw & 2)
+               cnt = &rwstat->cpu_cnt[2];
+       else
+               cnt = &rwstat->cpu_cnt[3];
+       cnt->count += val;
+}
+extern unsigned long long rq_start_time_ns(void);
+extern unsigned long long rq_io_start_time_ns(void);
+extern int rq_is_sync(void);
+extern void cfq_arm_slice_timer(void);
+void cfq_completed_request(struct request *rq)
+{
+       struct cfq_queue *queue = rq->priv;
+       int sync = rq_is_sync();
+       struct cfq_group *group = queue->group;
+       long long start_time = rq_start_time_ns();
+       long long io_start_time = rq_io_start_time_ns();
+       int rw = rq->cmd_flags;
+
+       if (io_start_time < 1)
+               blkg_rwstat_add(&group->service_time, rw, 1 - io_start_time);
+       blkg_rwstat_add(0, rw, io_start_time - start_time);
+
+       if (rq->active_queue == queue && sync)
+               cfq_arm_slice_timer();
+}
+