public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/34637]  New: ICE in rws_insn_set, at config/ia64/ia64.c:5335
@ 2008-01-02  9:58 rguenth at gcc dot gnu dot org
  2008-01-02 10:11 ` [Bug target/34637] " rguenth at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-01-02  9:58 UTC (permalink / raw)
  To: gcc-bugs

The following testcase ICEs on the 4.1 branch with -O2 and up and on mainline
with
-O and up.

class Atomic {
public:
  static int add (int add_value, volatile int* dest);
};

inline int Atomic::add (int add_value, volatile int* dest) {
  int sum = 0;
  if (add_value == 1) {
    __asm__ volatile ("mf;;fetchadd4.acq %0=[%1],1;;" : "=r" (sum) : "r" (dest)
: "memory");
    ++sum;
  } else if (add_value == -1) {
    __asm__ volatile ("mf;;fetchadd4.acq %0=[%1],-1;;" : "=r" (sum) : "r"
(dest) : "memory");
    --sum;
  } else {
    int compare_value = 0;
    int exchange_value = 0;
    __asm__ volatile
      (
       "   mf;;"
       "0: ld4 %0=[%7];;"
       "   add %1=%6,%0;;"
       "   zxt4 %0=%0;;"
       "   mov ar.ccv=%0;;"
       "   cmpxchg4.acq %1=[%7],%1,ar.ccv;;"
       "   cmp4.ne p15,p0=%0,%1;"
       "   add %2=%6,%0;"
       "   (p15) br.cond.spnt 0b;;"
       : "=r" (compare_value) ,
       "=r" (exchange_value) ,
       "=r" (sum)
       : "0" (compare_value) ,
       "1" (exchange_value) ,
       "2" (sum) ,
       "r" (add_value) ,
       "r" (dest)
       : "p15", "memory");
  }
  return sum;
};

class FooClass {
private:
  static volatile int _pending_yields;
  static volatile int _pending_decrements;
public:
  void doit();
static void ack() {
    int decrement = _pending_decrements;
    if (decrement > 0) {
      Atomic::add(-decrement, &_pending_decrements);
      Atomic::add(-decrement, &_pending_yields);
    }
  }
};

void FooClass::doit() {
  FooClass::ack();
}

backtrace on mainline with a cross from x86_64 is

#1  0x0000000000d70bea in rws_insn_set (regno=14)
    at /space/rguenther/src/svn/trunk/gcc/config/ia64/ia64.c:5335
#2  0x0000000000d70854 in rws_access_regno (regno=14, flags=
      {is_write = 1, is_fp = 0, is_branch = 0, is_and = 0, is_or = 0,
is_sibcall = 0}, pred=0) at
/space/rguenther/src/svn/trunk/gcc/config/ia64/ia64.c:5431
#3  0x0000000000d70dcf in rws_access_reg (reg=0x2b03312f7b20, flags=
      {is_write = 1, is_fp = 0, is_branch = 0, is_and = 0, is_or = 0,
is_sibcall = 0}, pred=0) at
/space/rguenther/src/svn/trunk/gcc/config/ia64/ia64.c:5541
#4  0x0000000000d715e1 in rtx_needs_barrier (x=0x2b03312f7b20, flags=
      {is_write = 1, is_fp = 0, is_branch = 0, is_and = 0, is_or = 0,
is_sibcall = 0}, pred=0) at
/space/rguenther/src/svn/trunk/gcc/config/ia64/ia64.c:5794
#5  0x0000000000d71534 in rtx_needs_barrier (x=0x2b0330a318e0, flags=
      {is_write = 0, is_fp = 0, is_branch = 0, is_and = 0, is_or = 0,
is_sibcall = 0}, pred=0) at
/space/rguenther/src/svn/trunk/gcc/config/ia64/ia64.c:5775
#6  0x0000000000d71d3c in group_barrier_needed (insn=0x2b033094dfa0)
    at /space/rguenther/src/svn/trunk/gcc/config/ia64/ia64.c:6089
#7  0x0000000000d7209c in emit_all_insn_group_barriers (dump=0x0)
    at /space/rguenther/src/svn/trunk/gcc/config/ia64/ia64.c:6222
#8  0x0000000000d76da5 in ia64_reorg ()


-- 
           Summary: ICE in rws_insn_set, at config/ia64/ia64.c:5335
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org
GCC target triplet: ia64-*-*


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


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

end of thread, other threads:[~2008-01-11 21:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-02  9:58 [Bug target/34637] New: ICE in rws_insn_set, at config/ia64/ia64.c:5335 rguenth at gcc dot gnu dot org
2008-01-02 10:11 ` [Bug target/34637] " rguenth at gcc dot gnu dot org
2008-01-02 10:12 ` rguenth at gcc dot gnu dot org
2008-01-02 10:13 ` rguenth at gcc dot gnu dot org
2008-01-11 21:51 ` wilson 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).