[Bug target/61977] New: powerpc-eabi preprocessor breaks on lines that end with "vector"

drivshin at allworx dot com gcc-bugzilla@gcc.gnu.org
Thu Jul 31 15:32:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61977

            Bug ID: 61977
           Summary: powerpc-eabi preprocessor breaks on lines that end
                    with "vector"
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: drivshin at allworx dot com

Created attachment 33219
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33219&action=edit
patch to revert 210055 and 211656

The powerpc-eabi (and powerpc-eabispe -mno-spe; I haven't tried other
powerpc-*) preprocessor misbehaves when a line ends with "vector". I happened
to hit this in assembler comments, but that does not appear to be a
requirement.

Examples of lines which cause the failure:
vector
# vector
# x vector
x # vector
; vector
# .vector
# +vector

Examples of lines which do not cause the failure:
# vectors
# vector x
# vector.
# _vector
// vector   (unless -C is given)
vector;

The symptom depends on whether that is the last non-whitespace line in the
file. If it is, then the result is an ICE. If it is not, then just "vector"
appears by itself on the next line.

This did not happen on GCC 4.9.0, but does happen in GCC 4.9.1 and the current
trunk. Bisecting between 4.9.0 and 4.9.1 points to SVN revision 210055 as
introducing this behavior. Reverting r210055 (and also r211656 which seemed to
be dependant upon r210055) appears to fix the issue, and a patch (against
4.9.1) doing that is attached.

----

$ prefix/bin/powerpc-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=prefix/bin/powerpc-eabi-gcc
COLLECT_LTO_WRAPPER=/home/drivshin/gcc-powerpc-eabi/prefix/bin/../libexec/gcc/powerpc-eabi/4.9.1/lto-wrapper
Target: powerpc-eabi
Configured with: ../gcc-4.9.1/configure -v
--prefix=/home/drivshin/gcc-powerpc-eabi/build-gcc/../prefix
--target=powerpc-eabi --enable-languages=c
Thread model: single
gcc version 4.9.1 (GCC) 

---- 

$ echo -e "# comment ending in vector\n# another comment" |
prefix/bin/powerpc-eabi-cpp -x assembler-with-cpp
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "<stdin>"
# comment ending in
 vector
# 2 "<stdin>"
# another comment

----

$ echo -e "# comment ending in vector" | prefix/bin/powerpc-eabi-cpp -x
assembler-with-cpp
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "<stdin>"
<stdin>:1:0: internal compiler error: Segmentation fault
0x82f7bf crash_signal
        ../../gcc-4.9.1/gcc/toplev.c:337
0xc37b75 _cpp_lex_direct
        ../../gcc-4.9.1/libcpp/lex.c:2171
0xc389fb _cpp_lex_token
        ../../gcc-4.9.1/libcpp/lex.c:2055
0xc3d117 cpp_get_token_1
        ../../gcc-4.9.1/libcpp/macro.c:2359
0x559877 scan_translation_unit
        ../../gcc-4.9.1/gcc/c-family/c-ppoutput.c:176
0x559877 preprocess_file(cpp_reader*)
        ../../gcc-4.9.1/gcc/c-family/c-ppoutput.c:101
0x558360 c_common_init()
        ../../gcc-4.9.1/gcc/c-family/c-opts.c:1047
0x4ff08d c_objc_common_init()
        ../../gcc-4.9.1/gcc/c/c-objc-common.c:65
0x8312c6 lang_dependent_init
        ../../gcc-4.9.1/gcc/toplev.c:1712
0x8312c6 do_compile
        ../../gcc-4.9.1/gcc/toplev.c:1900



More information about the Gcc-bugs mailing list