Created attachment 22983 [details] reduced testcase Compiler output: $ gcc -mvzeroupper testcase.c testcase.c: In function 'foo': testcase.c:7:1: error: unrecognizable insn: (insn 12 6 13 2 (unspec_volatile [ (const_int 2 [0x2]) ] UNSPECV_VZEROUPPER) testcase.c:6 -1 (nil)) testcase.c:7:1: internal compiler error: in extract_insn, at recog.c:2109 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. (gdb) bt #0 fancy_abort (file=0x1121ad8 "/mnt/svn/gcc-trunk/gcc/recog.c", line=2109, function=0x11227ae "extract_insn") at /mnt/svn/gcc-trunk/gcc/diagnostic.c:892 #1 0x000000000085a535 in _fatal_insn (msgid=<value optimized out>, insn=0x7ffff5c9a798, file=0x1121ad8 "/mnt/svn/gcc-trunk/gcc/recog.c", line=2109, function=0x11227ae "extract_insn") at /mnt/svn/gcc-trunk/gcc/rtl-error.c:110 #2 0x000000000085a5d0 in _fatal_insn_not_found (insn=<value optimized out>, file=<value optimized out>, line=<value optimized out>, function=<value optimized out>) at /mnt/svn/gcc-trunk/gcc/rtl-error.c:118 #3 0x00000000008170a2 in extract_insn (insn=0x7ffff5c9a798) at /mnt/svn/gcc-trunk/gcc/recog.c:2109 #4 0x00000000008172cc in extract_insn_cached (insn=0x7ffff5c9a798) at /mnt/svn/gcc-trunk/gcc/recog.c:2012 #5 0x00000000006c1377 in cleanup_subreg_operands (insn=0x7ffff5c9a798) at /mnt/svn/gcc-trunk/gcc/final.c:2784 #6 0x0000000000812906 in split_insn (insn=<value optimized out>) at /mnt/svn/gcc-trunk/gcc/recog.c:2816 #7 0x000000000081af14 in split_all_insns () at /mnt/svn/gcc-trunk/gcc/recog.c:2870 #8 0x000000000081b0b9 in rest_of_handle_split_after_reload () at /mnt/svn/gcc-trunk/gcc/recog.c:3730 #9 0x00000000007ef846 in execute_one_pass (pass=0x1602320) at /mnt/svn/gcc-trunk/gcc/passes.c:1561 #10 0x00000000007efb35 in execute_pass_list (pass=0x1602320) at /mnt/svn/gcc-trunk/gcc/passes.c:1616 #11 0x00000000007efb47 in execute_pass_list (pass=0x1601e40) at /mnt/svn/gcc-trunk/gcc/passes.c:1617 #12 0x00000000007efb47 in execute_pass_list (pass=0x1601ea0) at /mnt/svn/gcc-trunk/gcc/passes.c:1617 #13 0x000000000092fdc6 in tree_rest_of_compilation (fndecl=0x7ffff5d6eb00) at /mnt/svn/gcc-trunk/gcc/tree-optimize.c:422 #14 0x0000000000af51e2 in cgraph_expand_function (node=0x7ffff5d75160) at /mnt/svn/gcc-trunk/gcc/cgraphunit.c:1522 #15 0x0000000000af7b9d in cgraph_output_in_order () at /mnt/svn/gcc-trunk/gcc/cgraphunit.c:1675 #16 cgraph_optimize () at /mnt/svn/gcc-trunk/gcc/cgraphunit.c:1836 #17 0x0000000000af7e2a in cgraph_finalize_compilation_unit () at /mnt/svn/gcc-trunk/gcc/cgraphunit.c:1042 #18 0x000000000050582c in c_write_global_declarations () at /mnt/svn/gcc-trunk/gcc/c-decl.c:9843 #19 0x00000000008d95f4 in compile_file (argc=13, argv=0x7fffffffdaf8) at /mnt/svn/gcc-trunk/gcc/toplev.c:591 #20 do_compile (argc=13, argv=0x7fffffffdaf8) at /mnt/svn/gcc-trunk/gcc/toplev.c:1874 #21 toplev_main (argc=13, argv=0x7fffffffdaf8) at /mnt/svn/gcc-trunk/gcc/toplev.c:1937 #22 0x00007ffff65f1bbd in __libc_start_main () from /lib/libc.so.6 #23 0x00000000004ec40d in _start () Tested revisions: r168843 - crash
Another target optimization bug.
A patch is posted at http://gcc.gnu.org/ml/gcc-patches/2011-05/msg01649.html
Author: hjl Date: Mon May 23 16:51:42 2011 New Revision: 174078 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174078 Log: Save the initial options after checking vzeroupper. gcc/ 2011-05-23 H.J. Lu <hongjiu.lu@intel.com> PR target/47315 * config/i386/i386.c (ix86_option_override_internal): Save the initial options after checking vzeroupper. gcc/testsuite/ 2011-05-23 H.J. Lu <hongjiu.lu@intel.com> PR target/47315 * gcc.target/i386/pr47315.c: New test. Added: trunk/gcc/testsuite/gcc.target/i386/pr47315.c Modified: trunk/gcc/ChangeLog trunk/gcc/config/i386/i386.c trunk/gcc/testsuite/ChangeLog
(In reply to comment #2) > A patch is posted at > > http://gcc.gnu.org/ml/gcc-patches/2011-05/msg01649.html H.J., Since this bug shows up in gcc 4.6, could you backport to gcc 4.6 branch? Thanks, Changpeng
(In reply to comment #4) > (In reply to comment #2) > > A patch is posted at > > > > http://gcc.gnu.org/ml/gcc-patches/2011-05/msg01649.html > > H.J., Since this bug shows up in gcc 4.6, could you backport to gcc 4.6 > branch? Thanks, > I have no plan to backport. Please feel free to backport.
(In reply to H.J. Lu from comment #5) > (In reply to comment #4) > > (In reply to comment #2) > > > A patch is posted at > > > > > > http://gcc.gnu.org/ml/gcc-patches/2011-05/msg01649.html > > > > H.J., Since this bug shows up in gcc 4.6, could you backport to gcc 4.6 > > branch? Thanks, > > > > I have no plan to backport. Please feel free to backport. Since gcc 4.6 branch is closed, there's no more need to backport, so I'm going to assume that this: (In reply to hjl@gcc.gnu.org from comment #3) > Author: hjl > Date: Mon May 23 16:51:42 2011 > New Revision: 174078 > > URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174078 > Log: > Save the initial options after checking vzeroupper. > > gcc/ > > 2011-05-23 H.J. Lu <hongjiu.lu@intel.com> > > PR target/47315 > * config/i386/i386.c (ix86_option_override_internal): Save the > initial options after checking vzeroupper. > > gcc/testsuite/ > > 2011-05-23 H.J. Lu <hongjiu.lu@intel.com> > > PR target/47315 > * gcc.target/i386/pr47315.c: New test. > > Added: > trunk/gcc/testsuite/gcc.target/i386/pr47315.c > Modified: > trunk/gcc/ChangeLog > trunk/gcc/config/i386/i386.c > trunk/gcc/testsuite/ChangeLog fixed it.