Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#16 GCC is not respecting the -E flag (crash/assertion)

open
nobody
None
5
2012-09-21
2010-04-15
Hubert Maier
No

gcc (GCC) 4.2.4 (adtools build 20090118)

Short:
g++ -dM -E - < /dev/null

crashes gcc with an assertion

assertion "cached == 0" failed: file "../../gcc/libcpp/line-map.c", line 277
cc1: internal compiler error: Aborted

Long:
I got a non-working ./configure in one of my posrts lately after the devs changed some of the structures within the project.
After talking to one of the maintainers (salty-horse) it seems the error lies within the amigaos4 build of gcc

I performed following test with it to be sure

g++ -dM -E - < /dev/null
should print all of the #define's but instead it crashed with the above message
(from manpage: -dM :
Instead of the normal output, generate a list of #define directives for all the macros defined during the execution of the
preprocessor, including predefined macros. This gives you a way of finding out what is predefined in your version of the
preprocessor.)

furthermore i tried

touch empty_file
g++ -dM -E empty_file
g++: empty_file: linker input file unused because linking not done
it shouldn't even compile it. -E says to stop after the preprocessing stage, that goes for the real-file test above aswell where i used an existing file which erroed out because of missing dependent files (i copied the file to another place where i could work with it solely)

Thanks a lot

(Most of the words honestly stolen from salty-horse during the IRC session, thanks salty)

Discussion

  • Ori Avtalion
    Ori Avtalion
    2010-04-17

    Further testing shows that "regular" gcc behaves the same when giving an input file that ends without c. So please ignore the empty_file test-case.
    The real issue is the crash on the - input file with /dev/null

     


Anonymous


Cancel   Add attachments