public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/15286] New: ICE cause by reload
@ 2004-05-04 20:49 fjahanian at apple dot com
  2004-05-04 21:35 ` [Bug target/15286] " pinskia at gcc dot gnu dot org
                   ` (36 more replies)
  0 siblings, 37 replies; 38+ messages in thread
From: fjahanian at apple dot com @ 2004-05-04 20:49 UTC (permalink / raw)
  To: gcc-bugs

A client test case ICEs in reload when compiled with -mcpu=G5 and -O1 (and above)
for apple-ppc-darwin.
This happens with mainline and tree-ssa gcc. But it may or may not fail with some
compilers (behavior is quite random and ICE happens if there is no hard register available
during reload, forcing store into temporary stack).

Code which causes this problem is (of course this sample does not ICE):

typedef unsigned long clock_t;

clock_t clock();

void foo()
{
        clock_t clock_start;

        clock_start=(((double)clock())/((double)(100)));
}

Problem is that gcc3.5 generates this RTL pattern for apple-ppc-dawin:

(insn 30 29 32 2 (set (subreg:DI (reg/v:SI 142 [ clock_start ]) 0)
        (fix:DI (reg:DF 158))) 216 {fix_truncdfdi2} (insn_list 28 (nil))
    (expr_list:REG_DEAD (reg:DF 158)
        (nil)))

Reload initially assigns hard register f0 to pseudo register 158, thus the pattern:

(insn 30 29 32 2 (set (subreg:DI (reg/v:SI 142 [ clock_start ]) 0)
        (fix:DI (reg:DF 32 f0 [158]))) 216 {fix_truncdfdi2} (insn_list 28 (nil))
    (expr_list:REG_DEAD (reg:DF 32 f0 [158])
        (nil)))

When there is no hard register available for  pseudo reg 142, reload will allocate
memory on stack to do a store/load operation. But to do so, reload generates the
following pattern:

(subreg:SI (reg:DI 32 f0) 4)

This is wrong. There is no movsi of an FPR. gcc then ICEs on:

error: unrecognizable insn:
(insn 247 30 32 2 (set (mem:SI (plus:SI (reg/f:SI 1 r1)
                (const_int 492 [0x1ec])) [0 clock_start+0 S4 A8])
        (subreg:SI (reg:DI 32 f0) 4)) -1 (nil)
    (nil))

-- 
           Summary: ICE cause by reload
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fjahanian at apple dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: powerpc-apple-darwin7.0.0
  GCC host triplet: powerpc-apple-darwin7.0.0
GCC target triplet: powerpc-apple-darwin7.0.0


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


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

end of thread, other threads:[~2004-10-28 13:44 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-04 20:49 [Bug target/15286] New: ICE cause by reload fjahanian at apple dot com
2004-05-04 21:35 ` [Bug target/15286] " pinskia at gcc dot gnu dot org
2004-05-04 21:44 ` fjahanian at apple dot com
2004-05-05 15:25 ` pinskia at gcc dot gnu dot org
2004-05-05 17:06 ` fjahanian at apple dot com
2004-05-12 16:41 ` fjahanian at apple dot com
2004-05-12 17:44 ` pinskia at gcc dot gnu dot org
2004-05-13  9:06 ` pinskia at gcc dot gnu dot org
2004-10-15 10:46 ` uweigand at gcc dot gnu dot org
2004-10-18  1:50 ` dje at watson dot ibm dot com
2004-10-18 12:47 ` uweigand at gcc dot gnu dot org
2004-10-24  2:59 ` dje at gcc dot gnu dot org
2004-10-24 22:52 ` dje at gcc dot gnu dot org
2004-10-25 15:46 ` dje at gcc dot gnu dot org
2004-10-25 15:54 ` uweigand at gcc dot gnu dot org
2004-10-25 16:20 ` uweigand at gcc dot gnu dot org
2004-10-25 16:47 ` dje at watson dot ibm dot com
2004-10-25 17:17 ` uweigand at gcc dot gnu dot org
2004-10-25 18:04 ` dje at watson dot ibm dot com
2004-10-25 18:34 ` dje at gcc dot gnu dot org
2004-10-25 18:39 ` fjahanian at apple dot com
2004-10-25 19:07 ` dje at watson dot ibm dot com
2004-10-25 19:12 ` fjahanian at apple dot com
2004-10-25 19:14 ` pinskia at gcc dot gnu dot org
2004-10-25 20:38 ` uweigand at gcc dot gnu dot org
2004-10-25 20:42 ` uweigand at gcc dot gnu dot org
2004-10-25 20:58 ` fjahanian at apple dot com
2004-10-25 21:04 ` uweigand at gcc dot gnu dot org
2004-10-25 21:11 ` dje at watson dot ibm dot com
2004-10-25 21:14 ` fjahanian at apple dot com
2004-10-25 23:43 ` dje at watson dot ibm dot com
2004-10-25 23:58 ` fjahanian at apple dot com
2004-10-26  0:13 ` dje at watson dot ibm dot com
2004-10-26  4:28 ` dje at watson dot ibm dot com
2004-10-26 15:17 ` fjahanian at apple dot com
2004-10-27 15:56 ` pinskia at gcc dot gnu dot org
2004-10-28 12:47 ` cvs-commit at gcc dot gnu dot org
2004-10-28 13:44 ` pinskia at gcc dot gnu dot org

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).