[Bug 501921] Re: [PR42611] Internal compiler error in tree.c
Bug Watch Updater
501921 at bugs.launchpad.net
Sat Mar 23 21:29:33 UTC 2013
** Changed in: gcc
Importance: Unknown => Medium
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-4.4 in Ubuntu.
https://bugs.launchpad.net/bugs/501921
Title:
[PR42611] Internal compiler error in tree.c
Status in The GNU Compiler Collection:
Fix Released
Status in “gcc-4.4” package in Ubuntu:
Fix Released
Bug description:
Binary package hint: gcc-4.4
OS: Ubuntu 9.10 Karmic Koala Linux version 2.6.31-16-generic
(buildd at rothera) (gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu8) )
#53-Ubuntu SMP Tue Dec 8 04:01:29 UTC 2009
GCC displays:
--------------------------------------------------------------------------------------------
demarcsek at alma:~/dev/secmem$ gcc secmem.c -Wall -o secmem
secmem.c: In function ‘main’:
secmem.c:42: warning: unused variable ‘x’
secmem.c:41: internal compiler error: in tree_low_cst, at tree.c:5014
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.4/README.Bugs> for instructions.
--------------------------------------------------------------------------------------------
after the attempt to compile the following .C file:
--------------------------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <memory.h>
#include <string.h>
#include <limits.h>
#include <errno.h>
#include <assert.h>
#define DEBUG_MODE 1
#define _DEBUG(str,param) { if( DEBUG_MODE == 1 ) { fprintf( stderr, "%s", "[DEBUG] " ); fprintf( stderr, str, param ); } }
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
typedef char bool_t;
typedef struct struct_secmem_conf {
int pagesize;
bool_t crypt;
int crypt_key;
bool_t to_file;
char dumpfile[ SSIZE_MAX ];
} secmem_conf;
void init_secmem( secmem_conf* d ) {
if( d->pagesize == 0 )
d->pagesize = sysconf( _SC_PAGESIZE );
_DEBUG( "Configuration: pagesize set to: %d\n", d->pagesize );
}
int main( int argc, char* argv[] ) {
secmem_conf x;
return 0;
}
--------------------------------------------------------------------------------------------
So the line mentioned above in the error message (secmem.c:41) contains:
int main( int argc, char* argv[] ) {
I expected gcc to compile this file without errors. The strange part is that if I
comment out the following line:
secmem_conf x;
it worked well, furthermore, when I changed 'typedef struct struct_secmem_conf {' to simply
'typedef struct {' it worked as well and it had not had any problems with line 41. In my opinion,
gcc gets confused if it finds an identifier beginning with 'struct'. Maybe it mistakes it for the 'struct'
reserved word.
Finally, it could compile my code, but this can be an interesting point to check out.
Thank you,
Demarcsek György
To manage notifications about this bug go to:
https://bugs.launchpad.net/gcc/+bug/501921/+subscriptions
More information about the foundations-bugs
mailing list