public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/33517]  New: bit field cause an internal compiler error: in schedule_region
@ 2007-09-21 10:31 veikko dot turkia at enermet dot com
  0 siblings, 0 replies; only message in thread
From: veikko dot turkia at enermet dot com @ 2007-09-21 10:31 UTC (permalink / raw)
  To: gcc-bugs

Compiler:

v850-elf-gcc -v
Reading specs from /usr/local/gcc333/lib/gcc-lib/v850-elf/3.3.3/specs
Configured with: ../configure --target=v850-elf --prefix=/usr/local/gcc333
--with-newlib --enable-languages=c
Thread model: single
gcc version 3.3.3


Source code:

typedef unsigned long long int  U64;    //   64-bit unsigned integer
typedef unsigned long int       U32;    //   32-bit unsigned integer
typedef unsigned short int      U16;    //   16-bit unsigned integer
typedef unsigned char           U8;     //    8-bit unsigned integer
typedef signed long long int    S64;    //   64-bit integer
typedef signed long int         S32;    //   32-bit integer
typedef signed short int        S16;    //   16-bit integer
typedef signed char             S8;     //    8-bit integer



#define REG_CNT 9

typedef struct
{
        //      register configuration structure

        U8      bit1:1;         

        U8      bit2:1;

        U8      bit3:1; 

        U8      bit4:1 ; 

        U8      bit5:1;

        U8      Par;    

} REG_CONF_S;

static REG_CONF_S regConf[ REG_CNT ];

extern U8 readRegConfEep( U8 reg, REG_CONF_S *confPtr );

extern U8 writeRegConfEep( U8 reg, const REG_CONF_S * const confPtr );

\f/************************* Function ************************/

int writeRegOnAutoScroll( int reg, int newAutoScroll )

/*************************************************************/

{
    REG_CONF_S eepConf;

    if (reg < REG_CNT) // valid register
    {
        // read old conf
        if ( readRegConfEep( reg, &eepConf ) == 0 )
        {
            eepConf.bit5 = newAutoScroll ? 1 : 0; // new state to conf

            if ( writeRegConfEep( reg, &eepConf ) == 0 ) // OK
            {
                regConf[ reg ] = eepConf; // restore ram

                return 0;
            }
            else // eeprom error
            {
                return -3;
            }
        }
        else // eeprom error
        {
            return -3;
        }
    }
    else // invalid reg number
    {
        return -2;
    }

} // writeRegOnAutoScroll


compile command:

v850-elf-gcc -mv850e -mdisable-callt -Wall -O2 -c -o ccerror.o ccerror.c

Error:

ccerror.c: In function `writeRegOnAutoScroll':
ccerror.c:75: internal compiler error: in schedule_region, at sched-rgn.c:2849
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

Compilation exited abnormally with code 1 at Fri Sep 21 11:16:49

Comments:

If I remove -O2 from command line then the error disappers,
also if I change the bit field "bit5" before "bit4" the compiler works good.
(Do the function work good in target system - that I don't know yet, but I will
test it soon)

Native compiler 3.4.2 compiles good

I had search that kind error from bug list, but I didn't find, so I write new
one.

t: Veikko Turkia


-- 
           Summary: bit field cause an internal compiler error: in
                    schedule_region
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: veikko dot turkia at enermet dot com
 GCC build triplet: v850-elf-gcc -mv850e -mdisable-callt -Wall -O2 -c -o
                    ccerror.o c
  GCC host triplet: linux fedora core release 3 kernel 2.6.9-1.667smp on an
                    i686
GCC target triplet: NEC v850 es


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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-09-21 10:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-21 10:31 [Bug c/33517] New: bit field cause an internal compiler error: in schedule_region veikko dot turkia at enermet dot com

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