Bug 47315 - ICE: in extract_insn, at recog.c:2109 (unrecognizable insn) with -mvzeroupper and __attribute__((target("avx")))
Summary: ICE: in extract_insn, at recog.c:2109 (unrecognizable insn) with -mvzeroupper...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL: http://gcc.gnu.org/ml/gcc-patches/201...
Keywords:
Depends on: 37565
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-16 14:03 UTC by Zdenek Sojka
Modified: 2018-03-12 02:28 UTC (History)
2 users (show)

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-01-16 15:57:54


Attachments
reduced testcase (82 bytes, text/plain)
2011-01-16 14:03 UTC, Zdenek Sojka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2011-01-16 14:03:59 UTC
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
Comment 1 H.J. Lu 2011-01-16 15:57:54 UTC
Another target optimization bug.
Comment 2 H.J. Lu 2011-05-23 16:00:22 UTC
A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2011-05/msg01649.html
Comment 3 hjl@gcc.gnu.org 2011-05-23 16:51:46 UTC
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
Comment 4 Changpeng Fang 2011-06-27 22:54:47 UTC
(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
Comment 5 H.J. Lu 2011-06-27 23:01:16 UTC
(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.
Comment 6 Eric Gallager 2018-03-12 02:28:34 UTC
(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.