]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/66140 (ICE at extract_insn, at recog.c:2343 when compiling for alpha...
authorUros Bizjak <ubizjak@gmail.com>
Sun, 17 May 2015 07:26:56 +0000 (09:26 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Sun, 17 May 2015 07:26:56 +0000 (09:26 +0200)
PR target/66140
* config/alpha/alpha.c (get_aligned_mem): Also look for reload
replacements in memory addresses.
(get_unaligned_address): Ditto.

testsuite/ChangeLog:

PR target/66140
* gcc.target/alpha/pr66140.c: New test.

From-SVN: r223267

gcc/ChangeLog
gcc/config/alpha/alpha.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/alpha/pr66140.c [new file with mode: 0644]

index 314ea43e7c9544e340c49b5603601556bd0c80f3..ee58ae98b5443cf5b4aa50b559750ce05c55b460 100644 (file)
@@ -1,3 +1,10 @@
+2015-05-16  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/66140
+       * config/alpha/alpha.c (get_aligned_mem): Also look for reload
+       replacements in memory addresses.
+       (get_unaligned_address): Ditto.
+
 2015-05-11  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
        * config/rs6000/rs6000.opt (-mcompat-align-parm): Reset initial
index 1fe6eb57f3280b4d4afde92af83ee2c7a34abcc3..2874b8454a9b6299ce06818a6369825ca8781cab 100644 (file)
@@ -1372,8 +1372,7 @@ get_aligned_mem (rtx ref, rtx *paligned_mem, rtx *pbitnum)
 
   gcc_assert (MEM_P (ref));
 
-  if (reload_in_progress
-      && ! memory_address_p (GET_MODE (ref), XEXP (ref, 0)))
+  if (reload_in_progress)
     {
       base = find_replacement (&XEXP (ref, 0));
       gcc_assert (memory_address_p (GET_MODE (ref), base));
@@ -1418,11 +1417,9 @@ get_unaligned_address (rtx ref)
 
   gcc_assert (MEM_P (ref));
 
-  if (reload_in_progress
-      && ! memory_address_p (GET_MODE (ref), XEXP (ref, 0)))
+  if (reload_in_progress)
     {
       base = find_replacement (&XEXP (ref, 0));
-
       gcc_assert (memory_address_p (GET_MODE (ref), base));
     }
   else
index dde3fb3e441e88175c3e7ba1195fb7adc60dd9b0..1aa99399aa188620a2a431e949b4bfe530afb6cc 100644 (file)
@@ -1,3 +1,8 @@
+2015-05-16  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/66140
+       * gcc.target/alpha/pr66140.c: New test.
+
 2015-05-05  Shanyao chen  <chenshanyao@huawei.com>
 
        Backported from mainline
diff --git a/gcc/testsuite/gcc.target/alpha/pr66140.c b/gcc/testsuite/gcc.target/alpha/pr66140.c
new file mode 100644 (file)
index 0000000..d559f69
--- /dev/null
@@ -0,0 +1,53 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mcpu=ev4" } */
+
+struct scsi_cmnd {
+       int sc_data_direction;
+};
+struct lpfc_hba {
+       unsigned cfg_total_seg_cnt;
+};
+struct lpfc_scsi_buf {
+       struct scsi_cmnd *pCmd;
+       unsigned seg_cnt;
+       unsigned *fcp_bpl;
+};
+
+extern void *sg_next(void *sg);
+extern void *scsi_sglist(struct scsi_cmnd *cmd);
+extern unsigned scsi_sg_count(struct scsi_cmnd *cmd);
+
+static inline void dma_map_sg_attrs(void *sg, int nents, int dir)
+{
+       int i;
+
+       for (i = 0; i < nents; i++, sg = sg_next(sg))
+               ;
+
+       if (!dir)
+               asm volatile( "call_pal %0" : : "i"(129));
+}
+
+static inline void lpfc_bg_setup_bpl(struct lpfc_hba *phba, struct scsi_cmnd *sc,
+                                    unsigned *pde5)
+{
+       void *sgde;
+       int i;
+
+       *pde5 = (((0x85 & 0x000000ff) << 24) | (*pde5 & ~(0x000000ff << 24)));
+       for (i = 0, sgde = scsi_sglist(sc); i < 2; i++, sgde = sg_next(sgde))
+               ;
+}
+
+void lpfc_bg_scsi_prep_dma_buf_s3(struct lpfc_hba *phba,
+                                 struct lpfc_scsi_buf *lpfc_cmd)
+{
+       struct scsi_cmnd *scsi_cmnd = lpfc_cmd->pCmd;
+       unsigned *bpl = lpfc_cmd->fcp_bpl;
+
+       dma_map_sg_attrs(scsi_sglist(scsi_cmnd),
+                        scsi_sg_count(scsi_cmnd),
+                        scsi_cmnd->sc_data_direction);
+       if (lpfc_cmd->seg_cnt > phba->cfg_total_seg_cnt)
+               lpfc_bg_setup_bpl(phba, scsi_cmnd, bpl);
+}