From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20446 invoked by alias); 9 Mar 2013 17:34:48 -0000 Received: (qmail 17206 invoked by uid 48); 9 Mar 2013 17:34:29 -0000 From: "ahyangyi at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/56580] New: Internal compiler error when trying to compile a sequence of NOPs inside a loop Date: Sat, 09 Mar 2013 17:34:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: X-Bugzilla-Severity: trivial X-Bugzilla-Who: ahyangyi at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-03/txt/msg00753.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D56580 Bug #: 56580 Summary: Internal compiler error when trying to compile a sequence of NOPs inside a loop Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: trivial Priority: P3 Component: c AssignedTo: unassigned@gcc.gnu.org ReportedBy: ahyangyi@gmail.com Created attachment 29629 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=3D29629 The code that triggers the bug. I am trying to do a silly thing: to produce a program that's bigger than my= L1 Instruction cache but smaller than my L2 cache, so the speed of the L2 cache can be measured. My implementation is simple: I put a sequence of NOPs as inline assembly, inside a for-loop. When I compile the code (see attachment) with -O2 or -O3 option, gcc 4.7.2 throws out internal error. Not that the bug is anywhere harmful. I can happily do without any optimiza= tion flags in this case. But I still think it's worth reporting, as fixing it ma= y be helpful to prevent other potential bugs. By the way, my other versions of g= cc (4.2.4, 4.4.7, 4.5.4) all work without any problems. The code in the attachment uses 12288 NOPS inside the for-loop, which loops 1000 times. Lowering the former to 10240 or lowering the latter to 500 both seem to eliminate the problem. I am using Gentoo Linux. When I compile my gcc-4.7.2 using Portage, I didn't set any optimization flags other than -O2 and -march=3Dnative. My machine i= s an i7 box. Finally, the following is the output of `gcc -v -save-temps -O2 GCC4.7-bug.= c`: Using built-in specs. COLLECT_GCC=3D/usr/x86_64-pc-linux-gnu/gcc-bin/4.7.2/gcc COLLECT_LTO_WRAPPER=3D/usr/libexec/gcc/x86_64-pc-linux-gnu/4.7.2/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /var/tmp/portage/sys-devel/gcc-4.7.2-r1/work/gcc-4.7.2/configure --prefix= =3D/usr --bindir=3D/usr/x86_64-pc-linux-gnu/gcc-bin/4.7.2 --includedir=3D/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/include --datadir=3D/usr/share/gcc-data/x86_64-pc-linux-gnu/4.7.2 --mandir=3D/usr/share/gcc-data/x86_64-pc-linux-gnu/4.7.2/man --infodir=3D/usr/share/gcc-data/x86_64-pc-linux-gnu/4.7.2/info --with-gxx-include-dir=3D/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/include/g++= -v4 --host=3Dx86_64-pc-linux-gnu --build=3Dx86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --without-ppl --without-cloog --enable-lto --enable-n= ls --without-included-gettext --with-system-zlib --enable-obsolete --disable-werror --enable-secureplt --enable-multilib --with-multilib-list=3Dm32,m64 --enable-libmudflap --disable-libssp --enable-libgomp --with-python-dir=3D/share/gcc-data/x86_64-pc-linux-gnu/4.7.2/python --enable-checking=3Drelease --enable-libstdcxx-time --enable-languages=3Dc,c++,java,go,fortran --enable-shared --enable-threads= =3Dposix --enable-__cxa_atexit --enable-clocale=3Dgnu --enable-targets=3Dall --with-bugurl=3Dhttp://bugs.gentoo.org/ --with-pkgversion=3D'Gentoo 4.7.2-r= 1 p1.4, pie-0.5.5' --enable-plugin Thread model: posix gcc version 4.7.2 (Gentoo 4.7.2-r1 p1.4, pie-0.5.5)=20 COLLECT_GCC_OPTIONS=3D'-v' '-save-temps' '-O2' '-mtune=3Dgeneric' '-march= =3Dx86-64' /usr/libexec/gcc/x86_64-pc-linux-gnu/4.7.2/cc1 -E -quiet -v GCC4.7-bug.c -mtune=3Dgeneric -march=3Dx86-64 -O2 -fpch-preprocess -o GCC4.7-bug.i ignoring nonexistent directory "/usr/local/include" ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/../../../../x86_64-pc-linux-gnu/inc= lude" #include "..." search starts here: #include <...> search starts here: /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/include /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/include-fixed /usr/include End of search list. COLLECT_GCC_OPTIONS=3D'-v' '-save-temps' '-O2' '-mtune=3Dgeneric' '-march= =3Dx86-64' /usr/libexec/gcc/x86_64-pc-linux-gnu/4.7.2/cc1 -fpreprocessed GCC4.7-bug.i -quiet -dumpbase GCC4.7-bug.c -mtune=3Dgeneric -march=3Dx86-64 -auxbase GCC= 4.7-bug -O2 -version -o GCC4.7-bug.s GNU C (Gentoo 4.7.2-r1 p1.4, pie-0.5.5) version 4.7.2 (x86_64-pc-linux-gnu) compiled by GNU C version 4.7.2, GMP version 5.0.2, MPFR version 3.= 1.1, MPC version 1.0.1 GGC heuristics: --param ggc-min-expand=3D100 --param ggc-min-heapsize=3D131= 072 GNU C (Gentoo 4.7.2-r1 p1.4, pie-0.5.5) version 4.7.2 (x86_64-pc-linux-gnu) compiled by GNU C version 4.7.2, GMP version 5.0.2, MPFR version 3.= 1.1, MPC version 1.0.1 GGC heuristics: --param ggc-min-expand=3D100 --param ggc-min-heapsize=3D131= 072 Compiler executable checksum: b73b2677ca23c504b32a2ee915f40344 GCC4.7-bug.c: In function =E2=80=98main=E2=80=99: GCC4.7-bug.c:12303:1: internal compiler error: in account_size_time, at ipa-inline-analysis.c:601 Please submit a full bug report, with preprocessed source if appropriate. See for instructions.