From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20447 invoked by alias); 22 Sep 2010 23:22:59 -0000 Received: (qmail 20075 invoked by uid 48); 22 Sep 2010 23:22:43 -0000 Date: Wed, 22 Sep 2010 23:22:00 -0000 Subject: [Bug c++/45752] New: [4.5 regression] ICE in ix86_vectorize_builtin_vec_perm_ok X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "y at momonga-linux dot org" 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 X-SW-Source: 2010-09/txt/msg02539.txt.bz2 g++ 4.5-20100916 ICEs with "-O3 -march=pentium4" when using the following code: template void transform(const T *in_points, int num_points, const float projection_mat[16], const float modelview_mat[16], float *out_points) { float mat[16]; int row, col; int i; const T *in_p; float *out_p; for (col = 0; col < 4; col++) { for (row = 0; row < 4; row++) { mat[col*4+row] = ( projection_mat[0*4+row]*modelview_mat[col*4+0] + projection_mat[1*4+row]*modelview_mat[col*4+1] + projection_mat[2*4+row]*modelview_mat[col*4+2] + projection_mat[3*4+row]*modelview_mat[col*4+3]); } } for (i = 0, in_p = in_points, out_p = out_points; i < num_points; i++, in_p += 3, out_p += 3) { for (row = 0; row < 3; row++) { out_p[row] = ( mat[0*4+row]*in_p[0] + mat[1*4+row]*in_p[1] + mat[2*4+row]*in_p[2] + mat[3*4+row]); } } if ( (mat[0*4+3] != 0) || (mat[1*4+3] != 0) || (mat[0*4+3] != 0) || (mat[1*4+3] != 1) ) { for (i = 0, in_p = in_points, out_p = out_points; i < num_points; i++, in_p += 3, out_p += 3) { float w = ( mat[0*4+3]*in_p[0] + mat[1*4+3]*in_p[1] + mat[2*4+3]*in_p[2] + mat[3*4+3]); if (w > 0.0) { out_p[0] /= w; out_p[1] /= w; out_p[2] /= w; } else { out_p[2] = -static_cast< float >(1.0e+38f); } } } } void TransformPoints(double *input, int num_input, const float projection_mat[16], const float modelview_mat[16], float *output) { transform(input, num_input, projection_mat, modelview_mat, output); } void TransformPoints(unsigned short *input, int num_input, const float projection_mat[16], const float modelview_mat[16], float *output) { transform(input, num_input, projection_mat, modelview_mat, output); } -- Summary: [4.5 regression] ICE in ix86_vectorize_builtin_vec_perm_ok Product: gcc Version: 4.5.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: y at momonga-linux dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45752