[Bug c++/91967] New: gtest from google generates incorrect assembly code on x86 solaris

2019-10-02 Thread bobw at cristie dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91967

Bug ID: 91967
   Summary: gtest from google generates incorrect assembly code on
x86 solaris
   Product: gcc
   Version: 9.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: bobw at cristie dot com
  Target Milestone: ---

I compile the latest version of gtest (from google) under cmake on Solaris 11.3
(x86), I see ...

cd
/export/home/jenkins/work/3rdparty/trunk/3rdparty/build/gtest_1_9_0/googletest
&& /usr/local/bin/c++  -DBOOST_ALL_DYN_LINK -DBOOST_ASIO_DYN_LINK
-DBOOST_AUTO_LINK_NOMANGLE -DBOOST_NETWORK_ENABLE_HTTPS
-DBOOST_NO_VARIADIC_TEMPLATES -D_GLIBCXX_HAS_GTHREADS -D_GLIBCXX__PTHREADS
-D_XPG6 -D__EXTENSIONS__ -Dsunos
-I/export/home/jenkins/work/3rdparty/trunk/cmake/../common/include
-I/export/home/jenkins/work/3rdparty/trunk/cmake/../common/basic
-I/export/home/jenkins/work/3rdparty/trunk/cmake/../unix/common/include
-I/export/home/jenkins/work/3rdparty/trunk/3rdparty/../include
-I/export/home/jenkins/work/3rdparty/trunk/3rdparty/build/openssl_1_1_1c/include
-I/export/home/jenkins/work/3rdparty/trunk/3rdparty/sqlite_3_28_0
-I/export/home/jenkins/work/3rdparty/trunk/3rdparty/gtest_1_9_0/googletest/include
-I/export/home/jenkins/work/3rdparty/trunk/3rdparty/gtest_1_9_0/googletest
-isystem
/export/home/jenkins/work/3rdparty/trunk/cmake/../3rdparty/boost_1_70_0 -DCMAKE
-fPIC -Wall -Wextra -Dunix -pthread -std=c++11 -Wno-unused-parameter
-Wno-unknown-pragmas -O2 -DNDEBUG   -Wall -Wshadow -Werror
-Wno-error=dangling-else -DGTEST_HAS_PTHREAD=1 -fexceptions -Wextra
-Wno-unused-parameter -Wno-missing-field-initializers -std=c++11 -o
CMakeFiles/gtest.dir/src/gtest-all.cc.o -c
/export/home/jenkins/work/3rdparty/trunk/3rdparty/gtest_1_9_0/googletest/src/gtest-all.cc
Assembler: gtest-all.cc
"/var/tmp//ccc2a4pF.s", line 84753 : Illegal mnemonic
Near line: "int3"
"/var/tmp//ccc2a4pF.s", line 84753 : Syntax error
Near line: "int3"

jenkins@solaris:~/work/3rdparty/trunk/3rdparty/build/gtest_1_9_0/googletest$
g++ --version
g++ (GCC) 9.2.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

jenkins@solaris:~/work/3rdparty/trunk/3rdparty/build/gtest_1_9_0/googletest$
uname -a
SunOS solaris 5.11 11.3 i86pc i386 i86pc
jenkins@solaris:~/work/3rdparty/trunk/3rdparty/build/gtest_1_9_0/googletest$
grep TOPLEVEL_CONFIGURE_ARGUMENTS ~/src/gcc/gcc-9.2.0/config.log
TOPLEVEL_CONFIGURE_ARGUMENTS='./configure'
jenkins@solaris:~/work/3rdparty/trunk/3rdparty/build/gtest_1_9_0/googletest$

[Bug c++/91967] gtest from google generates incorrect assembly code on x86 solaris

2019-10-02 Thread bobw at cristie dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91967

--- Comment #1 from bob wilkinson  ---
Created attachment 46990
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46990&action=edit
output of g++ with save-temps

[Bug target/91967] gtest from google generates incorrect assembly code on x86 solaris

2019-10-04 Thread bobw at cristie dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91967

--- Comment #3 from bob wilkinson  ---
You are correct it is inline assembly ...

4768 #elif (!defined(__native_client__)) &&\
4769 ((defined(__clang__) || defined(__GNUC__)) && \
4770  (defined(__x86_64__) || defined(__i386__)))
4771   // with clang/gcc we can achieve the same effect on x86 by invoking
int3
4772   asm("int3");
4773 #else

from gtest_1_9_0/googletest/src/gtest.cc

so I think that this is a google error, rather than gcc.

Please close this bug. It is not an error in gcc.