What is this GCC error on Linux, and how do I solve it? gcc: internal compiler error: Illegal instruction (program as)

后端 未结 5 673
春和景丽
春和景丽 2021-01-18 10:41

I type gcc hello.c and this appears:

gcc: internal compiler error: Illegal instruction (program as)
Please submit a full bug report,
with preproc         


        
5条回答
  •  南方客
    南方客 (楼主)
    2021-01-18 11:27

    I can only shed some light on the error message:

    gcc: internal compiler error: Illegal instruction (program as)

    gcc does several things when compiling. It first translates your C program into assembler and then converts the assembler into machine code.

    The name of the assembler program with gcc is just as. So the error message tells you, that running the assembler fails, because the assembler executable contains an illegal instruction.

    This might really be an hardware error, meaning that the executable of the assembler is broken.

    To check:

    1. Does gcc -S hello.c work ? That should create a "hello.s" containing the C code compiled to assembler
    2. You might try with gcc -v -c hello.c to find out what happens exactly.

提交回复
热议问题