From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5601 invoked by alias); 6 Jun 2012 05:07:25 -0000 Received: (qmail 5585 invoked by uid 22791); 6 Jun 2012 05:07:23 -0000 X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_GX X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 06 Jun 2012 05:07:11 +0000 From: "paulotorrens at gnu dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/53586] New: Internal compiler errors on cp/pt.c:12077 and expr.c:9147 Date: Wed, 06 Jun 2012 05:07: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: paulotorrens at gnu dot 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 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-06/txt/msg00279.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53586 Bug #: 53586 Summary: Internal compiler errors on cp/pt.c:12077 and expr.c:9147 Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: paulotorrens@gnu.org Trying to compile this small function: template auto ptr2bitmap(T *bitmap, int width, int depth = 3) -> typeof(typeof(unsigned char[depth])[width]) *{ return bitmap; }; I got this: Compiling `mjpeg.cpp'... mjpeg.cpp: In substitution of 'template unsigned char (* ptr2bitmap(T*, int, int))[width][depth] [with T = void]': mjpeg.cpp:223:39: required from here mjpeg.cpp:200:27: internal compiler error: in tsubst_copy, at cp/pt.c:12077 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. make: *** [mjpeg.o] Error 1 And, trying to compile this code: using uc3 = unsigned char[3]; using uc3w = uc3[width]; using uc3wp = uc3w *; auto img = (uc3wp)rgb; int w = 0; for(w = 0; w < font_GMT_width; w++) { for(int y = 0; y < font_height; y++) { ((img[y])[w])[0] = font_pixel(font_GMTX + w, y, 0); ((img[y])[w])[1] = font_pixel(font_GMTX + w, y, 1); ((img[y])[w])[2] = font_pixel(font_GMTX + w, y, 2); }; }; auto add = [&](int start) { for(int x = 0; x < font_char_width; x++, w++) { for(int y = 0; y < font_height; y++) { ((img[y])[w + x])[0] = font_pixel(start + x, y, 0); ((img[y])[w + x])[1] = font_pixel(start + x, y, 1); ((img[y])[w + x])[2] = font_pixel(start + x, y, 2); }; }; }; auto add_colon = [&] { add(font_ColonX); }; auto add_slash = [&] { add(font_SlashX); }; I got this: mjpeg.cpp: In static member function 'static void std::_Function_handler::_M_invoke(const std::_Any_data&, _ArgTypes ...) [with _Functor = MJPEG::Video::addJpg(void*, size_t, double, tm*) const::; _ArgTypes = {void*, long unsigned int, long unsigned int}]': mjpeg.cpp:228:20: internal compiler error: in expand_expr_real_1, at expr.c:9147 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. make: *** [mjpeg.o] Error 1 All tests were run on a Mac OS X Lion machine, and GCC as configured as follow: ../gcc-4.7.0/configure --prefix=/opt/local --build=x86_64-apple-darwin11 --enable-languages=c,c++,objc,obj-c++,lto,fortran,java --libdir=/opt/local/lib/gcc47 --includedir=/opt/local/include/gcc47 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-4.7 --with-libiconv-prefix=/opt/local --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-4.7 --with-gxx-include-dir=/opt/local/include/gcc47/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-ppl=/opt/local --with-cloog=/opt/local --enable-cloog-backend=isl --enable-stage1-checking --disable-multilib --enable-lto --with-as=/opt/local/bin/as --with-ld=/opt/local/bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --with-pkgversion='MacPorts gcc47 4.7.0_3'