From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32481 invoked by alias); 10 Oct 2012 18:28:41 -0000 Received: (qmail 32418 invoked by uid 48); 10 Oct 2012 18:28:23 -0000 From: "kuszmaul at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/54894] New: internal compiler error: in vect_get_vec_def_for_operand, at tree-vect-stmts.c:1286 Date: Wed, 10 Oct 2012 18:28:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kuszmaul at gmail dot com 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" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: 2012-10/txt/msg01001.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D54894 Bug #: 54894 Summary: internal compiler error: in vect_get_vec_def_for_operand, at tree-vect-stmts.c:1286 Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned@gcc.gnu.org ReportedBy: kuszmaul@gmail.com Created attachment 28415 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=3D28415 preprocessed code for matrix multiply I'm having trouble getting gcc to remember alignment information the attach= ed matrix multiplication code. So I introduced a temporary variable that is a pointer to a 16-byte aligned double, and ended up with this error: $ gcc -O3 -std=3Dc99 mm_tile.c -Wcast-align -o mm_tile mm_tile.c: In function =E2=80=98main=E2=80=99: mm_tile.c:46:5: internal compiler error: in vect_get_vec_def_for_operand, at tree-vect-stmts.c:1286 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Preprocessed source stored into /tmp/ccvYpDPi.out file, please attach this = to your bugreport. $ gcc --version gcc (GCC) 4.7.2 20120921 (Red Hat 4.7.2-2) Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ cat mm_tile.c /** BEGIN HIDDEN **/ #include #include #include typedef unsigned long long uint64_t; /* Allow us to change n on the compiler command line with for example -Dn= =3D1024 */ #ifndef n #define n 4096 #endif double A[n][n] __attribute__((aligned(16))); double B[n][n] __attribute__((aligned(16))); double C[n][n] __attribute__((aligned(16))); static float tdiff (struct timeval *start, struct timeval *end) { return (end->tv_sec-start->tv_sec) +1e-6*(end->tv_usec-start->tv_usec); } #include "verify.h" #define tilesize 128 /* void mmbase (double *restrict C, double *restrict A, double *restrict B)= { */ /* for (int kh =3D 0; kh < n; kh +=3D tilesize) { */ /* for (int il =3D 0; il < tilesize; il++) { */ /* for (int kl =3D 0; kl < tilesize; ++kl) { */ /* for (int jl =3D 0; jl < tilesize; jl++) { */ /* C[il*n+jl] +=3D A[il*n+kh+kl]*B[(kh+kl)*n+jl]; */ /* } */ /* } */ /* } */ /* } */ /* } */ /* void mm_js(double *restrict C, double *restrict A, double *restrict B) {= */ /* for (int jh =3D 0; jh < n; jh +=3D tilesize) { */ /* mmbase(&C[jh], &A[0], &B[jh]); */ /* } */ /* } */ typedef double adouble __attribute__((__aligned__(16))); int main(int argc, const char *argv[]) { parse_args(argc, argv); for (int i =3D 0; i < n; ++i) { for (int j =3D 0; j < n; ++j) { A[i][j] =3D (double)rand() / (double)RAND_MAX; B[i][j] =3D (double)rand() / (double)RAND_MAX; C[i][j] =3D 0; } } struct timeval start, end; gettimeofday(&start, NULL); /** END HIDDEN **/ for (int ih =3D 0; ih < n; ih +=3D tilesize) {=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20 ///\lilabel{block_loop_i} for (int jh =3D 0; jh < n; jh +=3D tilesize) {=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20 ///\lilabel{block_loop_k} for (int kh =3D 0; kh < n; kh +=3D tilesize) {=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20 ///\lilabel{block_loop_j} for (int il =3D 0; il < tilesize; ++il) {=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20 ///\lilabel{base_loop_i} adouble *Ap =3D (adouble *)&A[ih+il][kh]; for (int kl =3D 0; kl < tilesize; ++kl) {=20=20=20=20=20=20=20=20= =20=20=20=20=20=20 ///\lilabel{base_loop_k} for (int jl =3D 0; jl < tilesize; ++jl) {=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20 ///\lilabel{base_loop_j} C[ih+il][jh+jl] +=3D Ap[kl] * B[kh+kl][jh+jl]; ///\lilabel{base_multiply} } } } } /* mmbase(&C[ih][jh],&A[ih][0],&B[0][jh]); */ } /* mm_js(&C[ih][0], &A[ih][0], &B[0][0]); */ } /** BEGIN HIDDEN **/ gettimeofday(&end, NULL); printf("%0.6f\n", tdiff(&start, &end)); if (need_to_verify) verify(); return 0; } /** END HIDDEN **/