From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14855 invoked by alias); 30 Apr 2013 05:43:10 -0000 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 Received: (qmail 14794 invoked by uid 55); 30 Apr 2013 05:43:07 -0000 From: "tejohnson at google dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/44578] GCC generates MMX instructions but fails to generate "emms" Date: Tue, 30 Apr 2013 05:43:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: tejohnson at google dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ubizjak at gmail dot com X-Bugzilla-Target-Milestone: 4.7.4 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-SW-Source: 2013-04/txt/msg02385.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44578 --- Comment #12 from Teresa Johnson 2013-04-30 05:43:06 UTC --- On Mon, Apr 29, 2013 at 10:37 AM, ubizjak at gmail dot com wrote: > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44578 > > --- Comment #10 from Uros Bizjak 2013-04-29 17:37:03 UTC --- > (In reply to comment #9) >> It does fix the issue I had in this test case. But theoretically can't >> this pattern still generate an MMX reference in some cases? And I see >> other instances of the same constraint in i386.md - is there a larger >> issue here and how can we prevent this? > > Yes, leaks of MMX registers were quite problematic in the past. A lot of effort > went into insn patterns to balance register allocator to allow MMX registers > when necessary, and to avoid them otherwise. It looks that zero_extendsidi > pattern was skipped in these efforts. Thanks for the quick fix! > > -mno-mmx can be used to prevent MMX regs, but the allocator is quite well tuned > nowadays, so instantiation of %mmX registers when not strictly needed will be > considered a bug. I found that due to the header file structure I cannot use -mno-mmx in certain cases - i.e. when including the STL header file and compiling with c++11. Is this a known issue/limitation? (after adding "#include " to the top of my test.cc test case): $ /usr/local/google/home/tejohnson/gcc_trunk_1_validate/bld-gcc/install/bin/g++ -O test.cc -g -S -std=c++11 -mno-mmx In file included from /usr/local/google/home/tejohnson/gcc_trunk_1_validate/bld-gcc/install/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/include/xmmintrin.h:35:0, from /usr/local/google/home/tejohnson/gcc_trunk_1_validate/bld-gcc/install/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/include/x86intrin.h:34, from /usr/local/google/home/tejohnson/gcc_trunk_1_validate/bld-gcc/install/include/c++/4.9.0/bits/opt_random.h:33, from /usr/local/google/home/tejohnson/gcc_trunk_1_validate/bld-gcc/install/include/c++/4.9.0/random:51, from /usr/local/google/home/tejohnson/gcc_trunk_1_validate/bld-gcc/install/include/c++/4.9.0/bits/stl_algo.h:65, from /usr/local/google/home/tejohnson/gcc_trunk_1_validate/bld-gcc/install/include/c++/4.9.0/algorithm:62, from test.cc:6: /usr/local/google/home/tejohnson/gcc_trunk_1_validate/bld-gcc/install/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/include/mmintrin.h:31:3: error: #error "MMX instruction set not enabled" # error "MMX instruction set not enabled" ^ Thanks, Teresa > > -- > Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email > ------- You are receiving this mail because: ------- > You are on the CC list for the bug. -- Teresa Johnson | Software Engineer | tejohnson@google.com | 408-460-2413