From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12119 invoked by alias); 12 Apr 2013 13:50:33 -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 12081 invoked by uid 48); 12 Apr 2013 13:50:30 -0000 From: "glisse at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/56934] New: ICE folding a COND_EXPR involving vectors Date: Fri, 12 Apr 2013 13:50:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: glisse at gcc dot gnu.org 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" MIME-Version: 1.0 X-SW-Source: 2013-04/txt/msg01068.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56934 Bug #: 56934 Summary: ICE folding a COND_EXPR involving vectors Classification: Unclassified Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end AssignedTo: unassigned@gcc.gnu.org ReportedBy: glisse@gcc.gnu.org typedef long veci __attribute__((vector_size(16))); veci f(double a, veci b){ return (a<2)?(b<3):(b!=b); } e.cc: In function 'veci f(double, veci)': e.cc:3:27: internal compiler error: in fold_convert_loc, at fold-const.c:1972 return (a<2)?(b<3):(b!=b); ^ I think the folding should just be disabled in this case. Even if fold_convert was taught how to convert scalars to vectors, it would produce a vector {1,1} instead of {-1,-1} (and it would build a TRUTH_ANDIF_EXPR with vectors). I have a fix as part of another patch. An alternative fix would be to make truth_value_p return false for vectors, which would make us regress on several optimizations I guess.