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

            Bug ID: 91298
           Summary: Error: junk `(%rip)' after expression
           Product: gcc
           Version: 7.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: daffra.claudio at gmail dot com
  Target Milestone: ---

Error: junk `(%rip)' after expression

complete error message

    E:\provacx>   gcc lib\gc.c test\ex_vector_2.c -o   x.exe
    C:\Users\DAFFRA~1\AppData\Local\Temp\ccXznZk1.s: Assembler messages:
    C:\Users\DAFFRA~1\AppData\Local\Temp\ccXznZk1.s:161: Error: junk `(%rip)'
after expression
    C:\Users\DAFFRA~1\AppData\Local\Temp\ccXznZk1.s:163: Error: junk `(%rip)'
after expression
    C:\Users\DAFFRA~1\AppData\Local\Temp\ccXznZk1.s:163: Error: unsupported
instruction `mov'
    C:\Users\DAFFRA~1\AppData\Local\Temp\ccXznZk1.s:173: Error: junk `(%rip)'
after expression
    C:\Users\DAFFRA~1\AppData\Local\Temp\ccXznZk1.s:179: Error: junk `(%rip)'
after expression
    C:\Users\DAFFRA~1\AppData\Local\Temp\ccXznZk1.s:179: Error: unsupported
instruction `mov'
    C:\Users\DAFFRA~1\AppData\Local\Temp\ccXznZk1.s:180: Error: junk `(%rip)'
after expression

    #ifndef NORESULT
    #define NORESULT
    static int $result=0;
    #endif

    #define algorithm_AllOf(obj,id,from,to,lambda,flag)         \
    do {                                                        \
        obj##DataType##id* it;                                  \
        for ( it=from ; it!=to ; it++ )                         \
        {                                                       \
                if ( lambda )                                   \
                {                                               \
                    ++$result;                                  \
                }                                               \
        }                                                       \
        $result = ($result == obj##Size(v1)) ? 1 : 0 ;          \
    } while(0);


    int flag=0;

    algorithm_AllOf(vector,v1,vectorBegin(v1),vectorEnd(v1), *it % 2 == 0 ,
&flag);
    printf("\n[%d]\n",$result);

this piece of code give me previos error in :

E:\provacx>gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=C:/Qt/Qt5.12.3/Tools/mingw730_64/bin/../libexec/gcc/x86_64-w64-mingw32/7.3.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-7.3.0/configure --host=x86_64-w64-mingw32
--build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64
--with-sysroot=/c/mingw730/x86_64-730-posix-seh-rt_v5-rev0/mingw64
--enable-shared --enable-static --disable-multilib
--enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes
--enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto
--enable-graphite --enable-checking=release --enable-fully-dynamic-string
--enable-version-specific-runtime-libs --enable-libstdcxx-filesystem-ts=yes
--disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap
--disable-rpath --disable-win32-registry --disable-nls --disable-werror
--disable-symvers --with-gnu-as --with-gnu-ld --with-arch=nocona
--with-tune=core2 --with-libiconv --with-system-zlib
--with-gmp=/c/mingw730/prerequisites/x86_64-w64-mingw32-static
--with-mpfr=/c/mingw730/prerequisites/x86_64-w64-mingw32-static
--with-mpc=/c/mingw730/prerequisites/x86_64-w64-mingw32-static
--with-isl=/c/mingw730/prerequisites/x86_64-w64-mingw32-static
--with-pkgversion='x86_64-posix-seh-rev0, Built by MinGW-W64 project'
--with-bugurl=https://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe
-fno-ident -I/c/mingw730/x86_64-730-posix-seh-rt_v5-rev0/mingw64/opt/include
-I/c/mingw730/prerequisites/x86_64-zlib-static/include
-I/c/mingw730/prerequisites/x86_64-w64-mingw32-static/include' CXXFLAGS='-O2
-pipe -fno-ident
-I/c/mingw730/x86_64-730-posix-seh-rt_v5-rev0/mingw64/opt/include
-I/c/mingw730/prerequisites/x86_64-zlib-static/include
-I/c/mingw730/prerequisites/x86_64-w64-mingw32-static/include' CPPFLAGS='
-I/c/mingw730/x86_64-730-posix-seh-rt_v5-rev0/mingw64/opt/include
-I/c/mingw730/prerequisites/x86_64-zlib-static/include
-I/c/mingw730/prerequisites/x86_64-w64-mingw32-static/include' LDFLAGS='-pipe
-fno-ident -L/c/mingw730/x86_64-730-posix-seh-rt_v5-rev0/mingw64/opt/lib
-L/c/mingw730/prerequisites/x86_64-zlib-static/lib
-L/c/mingw730/prerequisites/x86_64-w64-mingw32-static/lib '
Thread model: posix
gcc version 7.3.0 (x86_64-posix-seh-rev0, Built by MinGW-W64 project)

but, if i remove 'static' keyword all work good

    #ifndef NORESULT
    #define NORESULT
    int $result=0;
    #endif


again if I remove the dollar character at the beginning of the identifier all
works for the best

    #ifndef NORESULT
    #define NORESULT
    static int $result=0;
    #endif

best regards
Claudio Daffra

Reply via email to