Bug 78004 - [6/7 Regression] g++ segfaults when compiling qt 4.8.7
Summary: [6/7 Regression] g++ segfaults when compiling qt 4.8.7
Status: RESOLVED DUPLICATE of bug 78224
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 7.0
: P3 normal
Target Milestone: 6.4
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2016-10-17 09:48 UTC by Natanael Copa
Modified: 2016-12-06 13:23 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2016-10-17 00:00:00


Attachments
qdeclarativeanimation.ii.gz (304.58 KB, application/gzip)
2016-10-17 11:32 UTC, Natanael Copa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Natanael Copa 2016-10-17 09:48:25 UTC
make[1]: Entering directory '/home/buildozer/aports/main/qt/src/qt-everywhere-opensource-src-4.8.7/src/declarative'
g++ -fno-aggressive-loop-optimizations -c -Os -fomit-frame-pointer -pipe -fPIC -std=gnu++98 -O2 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_BUILD_DECLARATIVE_LIB -DQT_NO_URL_CAST_FROM_STRING -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_NO_OPENTYPE -DQT_NO_DEBUG -DQT_SCRIPT_LIB -DQT_SVG_LIB -DQT_SQL_LIB -DQT_XMLPATTERNS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include/QtCore -I../../include/QtNetwork -I../../include/QtGui -I../../include/QtXmlPatterns -I../../include/QtSql -I../../include/QtSvg -I../../include/QtScript -I../../include -I../../include/QtDeclarative -I.rcc/release-shared -Iutil -Igraphicsitems -Iqml -Iqml/parser -Iqml/rewriter -Idebugger -I../3rdparty/harfbuzz/src -I.moc/release-shared -o .obj/release-shared/qdeclarativeanimation.o util/qdeclarativeanimation.cpp
util/qdeclarativeanimation.cpp: In member function 'virtual void QDeclarativeParentAnimation::transition(QDeclarativeStateActions&, QDeclarativeProperties&, QDeclarativeAbstractAnimation::TransitionDirection)':
util/qdeclarativeanimation.cpp:2598:6: internal compiler error: Segmentation fault
 void QDeclarativeParentAnimation::transition(QDeclarativeStateActions &actions,
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[1]: *** [Makefile:24007: .obj/release-shared/qdeclarativeanimation.o] Error 1
make[1]: Leaving directory '/home/buildozer/aports/main/qt/src/qt-everywhere-opensource-src-4.8.7/src/declarative'
make: *** [Makefile:711: sub-declarative-make_default-ordered] Error 2

$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/armv6-alpine-linux-muslgnueabihf/6.2.1/lto-wrapper
Target: armv6-alpine-linux-muslgnueabihf
Configured with: /home/buildozer/aports/main/gcc/src/gcc-6.2.0/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --build=armv6-alpine-linux-muslgnueabihf --host=armv6-alpine-linux-muslgnueabihf --target=armv6-alpine-linux-muslgnueabihf --with-pkgversion='Alpine 6.2.1' --enable-checking=release --disable-fixed-point --disable-libstdcxx-pch --disable-multilib --disable-nls --disable-werror --disable-symvers --enable-__cxa_atexit --enable-default-pie --enable-cloog-backend --enable-languages=c,c++,objc,java,fortran,ada --with-arch=armv6zk --with-tune=arm1176jzf-s --with-fpu=vfp --with-float=hard --with-abi=aapcs-linux --disable-libquadmath --disable-libssp --disable-libmpx --disable-libmudflap --disable-libsanitizer --enable-shared --enable-threads --enable-tls --disable-libitm --with-system-zlib --with-linker-hash-style=gnu
Thread model: posix
gcc version 6.2.1 20160822 (Alpine 6.2.1) 


This is with musl libc on a armv8l compile server.
Comment 1 Natanael Copa 2016-10-17 09:51:54 UTC
Qt is built without precompiled headers. (with -no-pch)
Comment 2 ktkachov 2016-10-17 09:53:24 UTC
We'll need a preprocessed source file and the exact compile command as per https://gcc.gnu.org/bugs/
Comment 3 Natanael Copa 2016-10-17 11:32:22 UTC
Created attachment 39822 [details]
qdeclarativeanimation.ii.gz

It segfaults with -O1 and -O2 but not with -Os or -O0.
Comment 4 Natanael Copa 2016-10-17 11:38:56 UTC
It seems to be reproducible on 32 bit x86 too with:

$ g++  -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i586-alpine-linux-musl/6.2.1/lto-wrapper
Target: i586-alpine-linux-musl
Configured with: /home/ncopa/aports/main/gcc/src/gcc-6.2.0/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --build=i586-alpine-linux-musl --host=i586-alpine-linux-musl --target=i586-alpine-linux-musl --with-pkgversion='Alpine 6.2.1' --enable-checking=release --disable-fixed-point --disable-libstdcxx-pch --disable-multilib --disable-nls --disable-werror --disable-symvers --enable-__cxa_atexit --enable-default-pie --enable-cloog-backend --enable-languages=c,c++,objc,java,fortran,ada --with-arch=i586 --with-tune=generic --enable-cld --disable-libssp --disable-libmpx --disable-libmudflap --disable-libsanitizer --enable-shared --enable-threads --enable-tls --with-system-zlib --with-linker-hash-style=gnu
Thread model: posix
gcc version 6.2.1 20160822 (Alpine 6.2.1)
Comment 5 Markus Trippelsdorf 2016-10-17 12:09:49 UTC
util/qdeclarativeanimation.cpp:2598:6: error: missing PHI def
scale_97 = PHI <_461(248), 1.0e+0(118), (114)>
util/qdeclarativeanimation.cpp:2598:6: internal compiler error: verify_gimple failed

Reducing...
Comment 6 Markus Trippelsdorf 2016-10-17 12:23:07 UTC
markus@x4 tmp % cat qdeclarativeanimation.ii
struct QVariant {
  ~QVariant();
};
struct A {
  QVariant toValue;
};
extern "C" {
void atan2(int, int);
float sqrtf(float);
}
int a, b;
void QDeclarativeParentAnimationtransition() {
  float c;
  A d;
  if (b)
    c = sqrtf(a);
  atan2(0, c);
}

markus@x4 tmp % g++ -c -O2 qdeclarativeanimation.ii
qdeclarativeanimation.ii: In function ‘void QDeclarativeParentAnimationtransition()’:
qdeclarativeanimation.ii:12:6: error: missing PHI def
 void QDeclarativeParentAnimationtransition() {
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c_5 = PHI <c_9(D)(2), _11(7), (3)>
qdeclarativeanimation.ii:12:6: internal compiler error: verify_gimple failed
0xda8090 verify_gimple_in_cfg(function*, bool)
        ../../gcc/gcc/tree-cfg.c:5208
0xc89707 execute_function_todo
        ../../gcc/gcc/passes.c:1965
0xc8a7dc execute_todo
        ../../gcc/gcc/passes.c:2015
Comment 7 Richard Earnshaw 2016-10-17 13:10:45 UTC
(In reply to Natanael Copa from comment #4)
> It seems to be reproducible on 32 bit x86 too with:
> 
> $ g++  -v
> Using built-in specs.
> COLLECT_GCC=g++
> COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i586-alpine-linux-musl/6.2.1/lto-wrapper
> Target: i586-alpine-linux-musl
> Configured with: /home/ncopa/aports/main/gcc/src/gcc-6.2.0/configure
> --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
> --build=i586-alpine-linux-musl --host=i586-alpine-linux-musl
> --target=i586-alpine-linux-musl --with-pkgversion='Alpine 6.2.1'
> --enable-checking=release --disable-fixed-point --disable-libstdcxx-pch
> --disable-multilib --disable-nls --disable-werror --disable-symvers
> --enable-__cxa_atexit --enable-default-pie --enable-cloog-backend
> --enable-languages=c,c++,objc,java,fortran,ada --with-arch=i586
> --with-tune=generic --enable-cld --disable-libssp --disable-libmpx
> --disable-libmudflap --disable-libsanitizer --enable-shared --enable-threads
> --enable-tls --with-system-zlib --with-linker-hash-style=gnu
> Thread model: posix
> gcc version 6.2.1 20160822 (Alpine 6.2.1)

You say this is on ARM, but this is clearly a configuration for an x86 compiler.
Comment 8 Richard Earnshaw 2016-10-17 13:11:33 UTC
(In reply to Richard Earnshaw from comment #7)
> (In reply to Natanael Copa from comment #4)
> > It seems to be reproducible on 32 bit x86 too with:
> > 
> > $ g++  -v
> > Using built-in specs.
> > COLLECT_GCC=g++
> > COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i586-alpine-linux-musl/6.2.1/lto-wrapper
> > Target: i586-alpine-linux-musl
> > Configured with: /home/ncopa/aports/main/gcc/src/gcc-6.2.0/configure
> > --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
> > --build=i586-alpine-linux-musl --host=i586-alpine-linux-musl
> > --target=i586-alpine-linux-musl --with-pkgversion='Alpine 6.2.1'
> > --enable-checking=release --disable-fixed-point --disable-libstdcxx-pch
> > --disable-multilib --disable-nls --disable-werror --disable-symvers
> > --enable-__cxa_atexit --enable-default-pie --enable-cloog-backend
> > --enable-languages=c,c++,objc,java,fortran,ada --with-arch=i586
> > --with-tune=generic --enable-cld --disable-libssp --disable-libmpx
> > --disable-libmudflap --disable-libsanitizer --enable-shared --enable-threads
> > --enable-tls --with-system-zlib --with-linker-hash-style=gnu
> > Thread model: posix
> > gcc version 6.2.1 20160822 (Alpine 6.2.1)
> 
> You say this is on ARM, but this is clearly a configuration for an x86
> compiler.

Ignore that, I see you said "also".
Comment 9 Markus Trippelsdorf 2016-10-17 13:46:21 UTC
Started with r230488:

commit ed9eac2c3d9bb4c0e6fb8fe128a197aa8687b337
Author: rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Tue Nov 17 18:51:55 2015 +0000

    Extend tree-call-cdce to calls whose result is used
Comment 10 Richard Biener 2016-12-06 13:23:41 UTC
Dup.

*** This bug has been marked as a duplicate of bug 78224 ***