public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kkojima at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/31403] wrong branch instructions generated with -m2a on sh-elf
Date: Fri, 20 Apr 2007 07:46:00 -0000	[thread overview]
Message-ID: <20070420074555.24163.qmail@sourceware.org> (raw)
In-Reply-To: <bug-31403-14137@http.gcc.gnu.org/bugzilla/>



------- Comment #2 from kkojima at gcc dot gnu dot org  2007-04-20 08:45 -------
A binary search shows that this started to fail from
the revision 123295

        * config/sh/sh.md (movsi_ie): Fix memory constraints attribute length.

I'd like to add Christian to the cc list because he must be interested
in this issue.  movsi_ie is used also for SH2A and I didn't know that
SH2A has 4-byte move instructions like mov.l reg,@(12-bit_disp,reg').
An easy fix would be the patch below, though I can't test it until
the other bootstrap/regtest cycles end up.

--- ORIG/trunk/gcc/config/sh/sh.md      2007-03-29 08:44:33.000000000 +0900
+++ LOCAL/trunk/gcc/config/sh/sh.md     2007-04-19 20:36:20.000000000 +0900
@@ -4968,7 +4968,36 @@ label:
        ! move optimized away"
   [(set_attr "type"
"pcload_si,move,movi8,move,*,load_si,mac_gp,prget,arith,store,mac_mem,pstore,gp_mac,prset,mem_mac,pload,load,fstore,pcload_si,gp_fpul,fpul_gp,fmove,fmove,fmove,nil")
    (set_attr "late_fp_use"
"*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,yes,*,*,yes,*,*,*,*")
-   (set_attr "length" "*,*,*,4,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,0")])
+   (set_attr_alternative "length"
+     [(const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 4)
+      (const_int 2)
+      (if_then_else
+       (ne (symbol_ref "TARGET_SH2A") (const_int 0))
+       (const_int 4) (const_int 2))
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (if_then_else
+       (ne (symbol_ref "TARGET_SH2A") (const_int 0))
+       (const_int 4) (const_int 2))
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 0)])])

 (define_insn "movsi_i_lowpart"
   [(set (strict_low_part (match_operand:SI 0 "general_movdst_operand"
"+r,r,r,r,r,r,r,m,r"))


-- 

kkojima at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kkojima at gcc dot gnu dot
                   |                            |org, christian dot bruel at
                   |                            |st dot com
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-04-20 08:45:54
               date|                            |
            Summary|Problem while compiling gcc |wrong branch instructions
                   |for sh-elf                  |generated with -m2a on sh-
                   |                            |elf


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31403


  parent reply	other threads:[~2007-04-20  7:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-30 17:43 [Bug target/31403] New: Problem while compiling gcc for sh-elf mstein at phenix dot rootshell dot be
2007-03-30 18:15 ` [Bug target/31403] " mstein at phenix dot rootshell dot be
2007-04-20  7:46 ` kkojima at gcc dot gnu dot org [this message]
2007-04-23  6:59 ` [Bug target/31403] wrong branch instructions generated with -m2a on sh-elf chrbr at gcc dot gnu dot org
2007-04-23  8:53 ` kkojima at gcc dot gnu dot org
2007-04-23 22:43 ` kkojima at gcc dot gnu dot org
2007-04-26  0:30 ` kkojima at gcc dot gnu dot org
2007-04-29 12:41 ` kkojima at gcc dot gnu dot org
     [not found] <bug-31403-4@http.gcc.gnu.org/bugzilla/>
2010-12-14 19:48 ` Stephen.Bartlett at opentv dot com
2010-12-15  0:36 ` kkojima at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070420074555.24163.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).