public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/53942] New: unable to find a register to spill in class 'CREG'
@ 2012-07-12 16:24 ncahill_alt at yahoo dot com
  2012-07-13 14:21 ` [Bug target/53942] [4.6/4.7/4.8 Regression] " ubizjak at gmail dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: ncahill_alt at yahoo dot com @ 2012-07-12 16:24 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53942
           Summary: unable to find a register to spill in class 'CREG'
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ncahill_alt@yahoo.com


This command:

gcc -O2 -mtune=pentium2 -fno-inline -x c++ -std=gnu++98 -c a.c -o a.o

gives this output:

### output ###
a.c: In function 'unsigned char _ZL1fP2S_h.isra.0(UINT16, UINT16, UINT16,
unsigned char)':
a.c:25:1: error: unable to find a register to spill in class 'CREG'
a.c:25:1: error: this is the insn:
(insn 11 7 12 2 (parallel [
            (set (reg:SI 1 dx [85])
                (ashiftrt:SI (reg:SI 1 dx [85])
                    (reg/v:QI 81 [ i ])))
            (clobber (reg:CC 17 flags))
        ]) a.c:20 409 {*ashrsi3_1}
     (expr_list:REG_UNUSED (reg:CC 17 flags)
        (nil)))
a.c:25: confused by earlier errors, bailing out
### end output ###

when compiling this testcase:

### a.c ###
typedef unsigned short UINT16;
typedef unsigned int UINT32;
typedef struct S_ S;

struct S_ {
  UINT16 data[3];
  UINT32 x;
  UINT32 y;
};

static inline S *get_S() {}

static unsigned char f(S *s, unsigned char i) 
{
  unsigned char c=0;
  unsigned char v;

  v = s->data[0]; 
  c|=v;
  v=((s->data[1])&(1<<i))?1:0; 
  c|=v<<1;
  v=((s->data[2])&0xff)&(1<<i); 
  c|=v<<2;
  return c;
}

void g() 
{
  S *s = get_S();
  s->x=f(s,6);
  s->y=f(s,7);
}
### end a.c ###

Using -mtune=i686 works.  I'm using gcc 4.7.1, i686-pc-linux-gnu, 32-bit.

Thank you.
Neil.


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

end of thread, other threads:[~2013-04-12 16:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-12 16:24 [Bug rtl-optimization/53942] New: unable to find a register to spill in class 'CREG' ncahill_alt at yahoo dot com
2012-07-13 14:21 ` [Bug target/53942] [4.6/4.7/4.8 Regression] " ubizjak at gmail dot com
2012-07-13 14:37 ` [Bug rtl-optimization/53942] " ubizjak at gmail dot com
2012-07-16 11:32 ` jakub at gcc dot gnu.org
2012-07-16 11:54 ` jakub at gcc dot gnu.org
2012-07-19 20:49 ` jakub at gcc dot gnu.org
2012-08-10 14:41 ` izamyatin at gmail dot com
2012-08-13  7:35 ` jakub at gcc dot gnu.org
2012-09-02 13:57 ` [Bug rtl-optimization/53942] [4.6 " ubizjak at gmail dot com
2013-04-12 16:27 ` jakub at gcc dot gnu.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).