Bug in C front-end?

Jim Little jiml@inconnect.com
Sun Mar 19 11:00:00 GMT 2000


I'm working on converting the gcc 2.95.2 C front-end into a stand-alone
C parser.  I've come across something that seems like it might be a bug,
but it's so basic that my first thought is that I'm missing something
obvious.  Here's the situation:

Given this program as input:

const int * const foo() {}

gcc defines this tree node as the function's return type (output
courtesy of debug_tree):

 <pointer_type 0x829ad84
    type <integer_type 0x828fa30 int allocated from permanent_obstack
        permanent SI
        size <integer_cst 0x828fc10 constant permanent 32>
        align 32 symtab 0 alias set -1 precision 32
        min <integer_cst 0x828fa90 constant permanent -2147483648>
        max <integer_cst 0x828faa8 constant permanent 2147483647>
        pointer_to_this <pointer_type 0x8295e2c>>
    allocated from permanent_obstack
    readonly unsigned permanent SI size <integer_cst 0x828fc10 32>
    align 32 symtab 0 alias set -1>

Note that the pointer_type node has a readonly flag but that the
integer_type node does not.  Why not?

Thanks,
Jim Little

--
The Prism project for simple, interoperable metaprograms. 
http://www.prism.cx


More information about the Gcc mailing list