Bug ID: 77702
           Summary: suffix or operands invalid for `movq'
           Product: gcc
           Version: 5.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot
          Reporter: jonhnanthan at gmail dot com
  Target Milestone: ---

Fails to compile at OS X 10.11.6 Homebrew version of GCC. I think it should

$ /usr/local/bin/gcc-5 main.c -o main
/var/folders/7c/sf7771js2lx54wp3hl7hsh1h0000gn/T//cc1dp4ru.s:13:suffix or
operands invalid for `movq'

$ /usr/local/bin/gcc-5 -O1 main.c -o main

$ ./main 
result: 2.302585

$ /usr/local/bin/gcc-5 -v
Using built-in specs.
Target: x86_64-apple-darwin15.5.0
Configured with: ../configure --build=x86_64-apple-darwin15.5.0
--enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-5
--with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr
--with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl014
--with-system-zlib --enable-libstdcxx-time=yes --enable-stage1-checking
--enable-checking=release --enable-lto --disable-werror
--with-pkgversion='Homebrew gcc5 5.4.0'
--enable-plugin --disable-nls --enable-multilib
Thread model: posix
gcc version 5.4.0 (Homebrew gcc5 5.4.0) 

$ cat main.c
#include <stdio.h>
#include <math.h>

int main() {
    printf("result: %f\n", log(10));
    return 0;

Only works if optimization is turned on.

Reply via email to