public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "hstong at ca dot ibm.com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/61041] New: Cannot create std::tr1::variate_generator from variate_generator::engine(); engine_value_type error Date: Sat, 03 May 2014 00:15:00 -0000 [thread overview] Message-ID: <bug-61041-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61041 Bug ID: 61041 Summary: Cannot create std::tr1::variate_generator from variate_generator::engine(); engine_value_type error Product: gcc Version: 4.8.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hstong at ca dot ibm.com http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.tr1 shows that support for ISO/IEC DTR 19768 subclause 5.1.3 is available in libstdc++. It seems that engine_value_type in libstdc++ is not defined such that it matches 5.1.3 paragraph 2 (assuming the DTR is close enough to the TR): The template argument for the parameter Engine shall be of the form U, U&, or U*, where U denotes a class that satisfies all the requirements of a uniform random number generator. The member engine_value_type shall name U. The following small client for <tr1/random> generates error messages showing that the engine_value_type typedef is some specialization of std::tr1::__detail::_Adaptor and not the corresponding "U" for U& = ::EngineType. ### SOURCE:> cat engine_value_type.cc #include <tr1/random> typedef std::tr1::linear_congruential<unsigned, 1, 0, 2048> &EngineType; typedef std::tr1::uniform_int<unsigned> DistType; std::tr1::variate_generator<EngineType, DistType> getWithNewDist(std::tr1::variate_generator<EngineType, DistType> &orig, const DistType &newDist) { return std::tr1::variate_generator<EngineType, DistType>(orig.engine(), newDist); } ### COMPILER INVOCATION AND OUTPUT:> g++ engine_value_type.cc engine_value_type.cc: In function ‘std::tr1::variate_generator<std::tr1::linear_congruential<unsigned int, 1u, 0u, 2048u>&, std::tr1::uniform_int<unsigned int> > getWithNewDist(std::tr1::variate_generator<std::tr1::linear_congruential<unsigned int, 1u, 0u, 2048u>&, std::tr1::uniform_int<unsigned int> >&, const DistType&)’: engine_value_type.cc:8:83: error: no matching function for call to ‘std::tr1::variate_generator<std::tr1::linear_congruential<unsigned int, 1u, 0u, 2048u>&, std::tr1::uniform_int<unsigned int> >::variate_generator(std::tr1::variate_generator<std::tr1::linear_congruential<unsigned int, 1u, 0u, 2048u>&, std::tr1::uniform_int<unsigned int> >::engine_value_type&, const DistType&)’ return std::tr1::variate_generator<EngineType, DistType>(orig.engine(), newDist); ^ engine_value_type.cc:8:83: note: candidates are: In file included from /usr/lib/gcc/x86_64-pc-cygwin/4.8.2/include/c++/tr1/random:47:0, from engine_value_type.cc:1: /usr/lib/gcc/x86_64-pc-cygwin/4.8.2/include/c++/tr1/random.h:252:7: note: std::tr1::variate_generator<_Engine, _Dist>::variate_generator(std::tr1::variate_generator<_Engine, _Dist>::engine_type, std::tr1::variate_generator<_Engine, _Dist>::distribution_type) [with _Engine = std::tr1::linear_congruential<unsigned int, 1u, 0u, 2048u>&; _Dist = std::tr1::uniform_int<unsigned int>; std::tr1::variate_generator<_Engine, _Dist>::engine_type = std::tr1::linear_congruential<unsigned int, 1u, 0u, 2048u>&; std::tr1::variate_generator<_Engine, _Dist>::distribution_type = std::tr1::uniform_int<unsigned int>] variate_generator(engine_type __eng, distribution_type __dist) ^ /usr/lib/gcc/x86_64-pc-cygwin/4.8.2/include/c++/tr1/random.h:252:7: note: no known conversion for argument 1 from ‘std::tr1::variate_generator<std::tr1::linear_congruential<unsigned int, 1u, 0u, 2048u>&, std::tr1::uniform_int<unsigned int> >::engine_value_type {aka std::tr1::__detail::_Adaptor<std::tr1::linear_congruential<unsigned int, 1u, 0u, 2048u>&, std::tr1::uniform_int<unsigned int> >}’ to ‘std::tr1::variate_generator<std::tr1::linear_congruential<unsigned int, 1u, 0u, 2048u>&, std::tr1::uniform_int<unsigned int> >::engine_type {aka std::tr1::linear_congruential<unsigned int, 1u, 0u, 2048u>&}’ /usr/lib/gcc/x86_64-pc-cygwin/4.8.2/include/c++/tr1/random.h:228:11: note: std::tr1::variate_generator<std::tr1::linear_congruential<unsigned int, 1u, 0u, 2048u>&, std::tr1::uniform_int<unsigned int> >::variate_generator(const std::tr1::variate_generator<std::tr1::linear_congruential<unsigned int, 1u, 0u, 2048u>&, std::tr1::uniform_int<unsigned int> >&) class variate_generator ^ /usr/lib/gcc/x86_64-pc-cygwin/4.8.2/include/c++/tr1/random.h:228:11: note: candidate expects 1 argument, 2 provided ### VERSION INFO:> g++ --version g++ (GCC) 4.8.2 Copyright (C) 2013 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. >From gcc-bugs-return-450418-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat May 03 01:00:35 2014 Return-Path: <gcc-bugs-return-450418-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org> Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 31297 invoked by alias); 3 May 2014 01:00:34 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: <gcc-bugs.gcc.gnu.org> List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/> List-Post: <mailto:gcc-bugs@gcc.gnu.org> List-Help: <mailto:gcc-bugs-help@gcc.gnu.org> Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 31259 invoked by uid 48); 3 May 2014 01:00:31 -0000 From: "su at cs dot ucdavis.edu" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/61042] New: ICE on valid code at -O3 on x86_64-linux-gnu Date: Sat, 03 May 2014 01:00:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 4.10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: su at cs dot ucdavis.edu X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: <bug-61042-4@http.gcc.gnu.org/bugzilla/> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-05/txt/msg00110.txt.bz2 Content-length: 2178 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61042 Bug ID: 61042 Summary: ICE on valid code at -O3 on x86_64-linux-gnu Product: gcc Version: 4.10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: su at cs dot ucdavis.edu The following code causes an ICE when compiled with the current gcc trunk at -O3 on x86_64-linux-gnu in both 32-bit and 64-bit modes. It is a regression from 4.9.x. $ gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/4.10.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk --enable-languages=c,c++ --disable-werror --enable-multilib Thread model: posix gcc version 4.10.0 20140502 (experimental) [trunk revision 210000] (GCC) $ $ gcc-trunk -O2 -c small.c $ gcc-4.9 -O3 -c small.c $ $ gcc-trunk -O3 -c small.c small.c: In function ‘foo’: small.c:4:1: internal compiler error: Segmentation fault foo () ^ 0x95c21f crash_signal ../../gcc-trunk/gcc/toplev.c:337 0x9b07d5 bb_predicate ../../gcc-trunk/gcc/tree-if-conv.c:149 0x9b07d5 is_predicated ../../gcc-trunk/gcc/tree-if-conv.c:275 0x9b07d5 is_cond_scalar_reduction ../../gcc-trunk/gcc/tree-if-conv.c:1442 0x9b07d5 predicate_scalar_phi ../../gcc-trunk/gcc/tree-if-conv.c:1583 0x9b07d5 predicate_all_scalar_phis ../../gcc-trunk/gcc/tree-if-conv.c:1637 0x9b07d5 combine_blocks ../../gcc-trunk/gcc/tree-if-conv.c:1954 0x9b178e tree_if_conversion ../../gcc-trunk/gcc/tree-if-conv.c:2108 0x9b178e execute ../../gcc-trunk/gcc/tree-if-conv.c:2187 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions. $ -------------------------- int a, b, c[1], d, f; void foo () { for (; b; b++) c[0] = c[f] && (d = a); } >From gcc-bugs-return-450419-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat May 03 01:19:24 2014 Return-Path: <gcc-bugs-return-450419-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org> Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 5986 invoked by alias); 3 May 2014 01:19:23 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: <gcc-bugs.gcc.gnu.org> List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/> List-Post: <mailto:gcc-bugs@gcc.gnu.org> List-Help: <mailto:gcc-bugs-help@gcc.gnu.org> Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 5924 invoked by uid 55); 3 May 2014 01:19:17 -0000 From: "sgk at troutmask dot apl.washington.edu" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/61002] Can't divide by 0 Date: Sat, 03 May 2014 01:19:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sgk at troutmask dot apl.washington.edu X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: <bug-61002-4-YrGDKOysj5@http.gcc.gnu.org/bugzilla/> In-Reply-To: <bug-61002-4@http.gcc.gnu.org/bugzilla/> References: <bug-61002-4@http.gcc.gnu.org/bugzilla/> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-05/txt/msg00111.txt.bz2 Content-length: 1017 http://gcc.gnu.org/bugzilla/show_bug.cgi?ida002 --- Comment #8 from Steve Kargl <sgk at troutmask dot apl.washington.edu> --- On Fri, May 02, 2014 at 02:24:40PM +0000, dominiq at lps dot ens.fr wrote: > > What is the best way to avoid the misleading "This check can be disabled with > the option -fno-range-check" for integers? Use "This check can be disabled for > floating point values with the option -fno-range-check"? or pass an extra > argument to gfc_arith_error? > > While I am at it, should I do the same thing for "Arithmetic overflow" and > friends? Should not "This check can be disabled with the option > -fno-range-check" ends with a dot? Traditional error messages did not end with punctuation. When error messages started to be more than a sentence, we needed to punctuate the first sentence(s), and the last sentence was left unpunctuated. Instead of "This check ... ". Simply use "See -fno-range-check". Then gfortran.info can add a lengthy description about what -fno-range-check does.
next reply other threads:[~2014-05-03 0:15 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-05-03 0:15 hstong at ca dot ibm.com [this message] 2014-09-19 13:18 ` [Bug libstdc++/61041] " redi 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-61041-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).