ICE verify_stmts failed (invalid operand to unary operator) with -ftree-vectorize and -O: (sid)105:tbm@usurper: ~] /usr/lib/gcc-snapshot/bin/gcc -ftree-vectorize -O1 -c linphone-synths.c linphone-synths.c: In function 'synths_': linphone-synths.c:9: error: invalid operand to unary operator iftmp.0D.1919_15 <= 9.900000095367431640625e-1; linphone-synths.c:9: internal compiler error: verify_stmts failed Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. (sid)106:tbm@usurper: ~] /usr/lib/gcc-snapshot/bin/gcc -ftree-vectorize -c linphone-synths.c (sid)107:tbm@usurper: ~] /usr/lib/gcc-snapshot/bin/gcc -O3 -c linphone-synths.c (sid)108:tbm@usurper: ~] gcc-4.1 -O3 -c linphone-synths.c (sid)109:tbm@usurper: ~]
Created attachment 12153 [details] test case Testcase from application "linphone".
I bet this is tree-ifcvt that is causing it and not really the vectorizer, I will check later today.
And I was correct. 4.1.2 has the bug too: _ifc_.33_28 = !(r__2_11 <= 9.900000095367431640625e-1) || _ifc_.30_3; that is invalid gimple.
Confirmed, reduced testcase: int synths_ ( float * rc) { float r1, r2; int i; for (i = 0; i < 128; ++i) { r2 = rc[i]; r1 = ((r2) <= (.99f) ? (r2) : (.99f)); rc[i] = ((r1) >= (-.99f) ? (r1) : (-.99f)); } } ---- Janis, Could you run a regression hunt on this bug? Thanks, Andrew
A regression hunt on powerpc-linux identified this patch: http://gcc.gnu.org/viewcvs?view=rev&rev=99691 r99691 | kazu | 2005-05-14 00:46:12 +0000 (Sat, 14 May 2005)
(In reply to comment #5) > A regression hunt on powerpc-linux identified this patch: That means it is a latent bug :) oh well, nothing useful really.
I have a patch. The vectorizer oughts to use more of the infrastructure we have.
(In reply to comment #7) > I have a patch. The vectorizer oughts to use more of the infrastructure we > have. This has nothing to do with the vectorizer really, yes tree-ifcvt is only enabled with -ftree-vectorize but it could be made even more generic.
Subject: Bug number PR28900 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-09/msg00068.html
Subject: Bug 28900 Author: rguenth Date: Tue Sep 5 08:39:42 2006 New Revision: 116697 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116697 Log: 2006-09-05 Richard Guenther <rguenther@suse.de> PR tree-optimization/28900 * tree-if-conv.c (find_phi_replacement_condition): Gimplify compound conditional before creating COND_EXPR condition. * gcc.dg/torture/pr28900.c: New testcase Added: trunk/gcc/testsuite/gcc.dg/torture/pr28900.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-if-conv.c
Fixed on the mainline.
Subject: Bug 28900 Author: rguenth Date: Mon Sep 18 10:13:42 2006 New Revision: 117021 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117021 Log: 2006-09-18 Richard Guenther <rguenther@suse.de> Backport from mainline: PR tree-optimization/28900 * tree-if-conv.c (find_phi_replacement_condition): Gimplify compound conditional before creating COND_EXPR condition. * gcc.dg/torture/pr28900.c: New testcase Added: branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/torture/pr28900.c - copied unchanged from r116697, trunk/gcc/testsuite/gcc.dg/torture/pr28900.c Modified: branches/gcc-4_1-branch/gcc/ChangeLog branches/gcc-4_1-branch/gcc/testsuite/ChangeLog branches/gcc-4_1-branch/gcc/tree-if-conv.c
Fixed.