public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "kuszmaul at gmail dot com" <gcc-bugzilla@gcc.gnu.org> 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 [thread overview] Message-ID: <bug-54894-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54894 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=28415 preprocessed code for matrix multiply I'm having trouble getting gcc to remember alignment information the attached 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=c99 mm_tile.c -Wcast-align -o mm_tile mm_tile.c: In function ‘main’: 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 <http://bugzilla.redhat.com/bugzilla> 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 <stdlib.h> #include <stdio.h> #include <sys/time.h> typedef unsigned long long uint64_t; /* Allow us to change n on the compiler command line with for example -Dn=1024 */ #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 = 0; kh < n; kh += tilesize) { */ /* for (int il = 0; il < tilesize; il++) { */ /* for (int kl = 0; kl < tilesize; ++kl) { */ /* for (int jl = 0; jl < tilesize; jl++) { */ /* C[il*n+jl] += 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 = 0; jh < n; jh += 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 = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { A[i][j] = (double)rand() / (double)RAND_MAX; B[i][j] = (double)rand() / (double)RAND_MAX; C[i][j] = 0; } } struct timeval start, end; gettimeofday(&start, NULL); /** END HIDDEN **/ for (int ih = 0; ih < n; ih += tilesize) { ///\lilabel{block_loop_i} for (int jh = 0; jh < n; jh += tilesize) { ///\lilabel{block_loop_k} for (int kh = 0; kh < n; kh += tilesize) { ///\lilabel{block_loop_j} for (int il = 0; il < tilesize; ++il) { ///\lilabel{base_loop_i} adouble *Ap = (adouble *)&A[ih+il][kh]; for (int kl = 0; kl < tilesize; ++kl) { ///\lilabel{base_loop_k} for (int jl = 0; jl < tilesize; ++jl) { ///\lilabel{base_loop_j} C[ih+il][jh+jl] += 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 **/
next reply other threads:[~2012-10-10 18:28 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-10-10 18:28 kuszmaul at gmail dot com [this message] 2012-10-10 18:47 ` [Bug tree-optimization/54894] [4.6/4.7/4.8 Regression] " jakub at gcc dot gnu.org 2012-10-11 12:23 ` jakub at gcc dot gnu.org 2012-10-11 12:34 ` jakub at gcc dot gnu.org 2012-10-11 14:16 ` rguenth at gcc dot gnu.org 2012-10-12 8:01 ` rguenth at gcc dot gnu.org 2012-10-12 8:10 ` [Bug tree-optimization/54894] [4.6/4.7 " rguenth at gcc dot gnu.org 2012-10-19 10:38 ` rguenth at gcc dot gnu.org 2012-11-26 14:26 ` rguenth at gcc dot gnu.org 2012-11-26 14:27 ` [Bug tree-optimization/54894] [4.6 " rguenth at gcc dot gnu.org 2013-04-12 16:27 ` jakub at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-54894-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).