public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61362] New: g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2 does not compile lambda with template
@ 2014-05-29 22:00 dgront at chem dot uw.edu.pl
  2014-05-29 22:01 ` [Bug c++/61362] " dgront at chem dot uw.edu.pl
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: dgront at chem dot uw.edu.pl @ 2014-05-29 22:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61362

            Bug ID: 61362
           Summary: g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2 does not compile
                    lambda with template
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dgront at chem dot uw.edu.pl

Minimal example of the problem:

#include <functional>

struct Node {
    size_t length;
};

template<typename N>
class C {
public:
  size_t longest = 0;
  std::function<void(const N )> f = [this](N node) {
    if(node->length > this->longest) this->longest = node->length;
  };
};

int main() {

  Node n;
  n.length = 5;
  C<Node*> c;
  c.f(&n);
}


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/61362] g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2 does not compile lambda with template
  2014-05-29 22:00 [Bug c++/61362] New: g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2 does not compile lambda with template dgront at chem dot uw.edu.pl
@ 2014-05-29 22:01 ` dgront at chem dot uw.edu.pl
  2014-05-30 15:07 ` daniel.kruegler at googlemail dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dgront at chem dot uw.edu.pl @ 2014-05-29 22:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61362

dgront at chem dot uw.edu.pl changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|unknown                     |4.8.2
           Severity|normal                      |major


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/61362] g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2 does not compile lambda with template
  2014-05-29 22:00 [Bug c++/61362] New: g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2 does not compile lambda with template dgront at chem dot uw.edu.pl
  2014-05-29 22:01 ` [Bug c++/61362] " dgront at chem dot uw.edu.pl
@ 2014-05-30 15:07 ` daniel.kruegler at googlemail dot com
  2014-05-30 15:14 ` daniel.kruegler at googlemail dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2014-05-30 15:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61362

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler@googlemail.
                   |                            |com

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
The code produces an ICE on gcc 4.8.2, 4.9.0, and recent 4.10.0 trunk:

"prog.cc: In instantiation of 'struct C<Node*>::__lambda0': prog.cc:8:7:
required from here prog.cc:11:38: internal compiler error: in tsubst_copy, at
cp/pt.c:12116 std::function<void(const N )> f = [this](N node) { ^ 0x51c14e
tsubst_copy ../../gcc-4.8.2/gcc/cp/pt.c:12116 0x51c743
tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
../../gcc-4.8.2/gcc/cp/pt.c:14455 0x51c7e2 tsubst_copy_and_build(tree_node*,
tree_node*, int, tree_node*, bool, bool) ../../gcc-4.8.2/gcc/cp/pt.c:14236
0x52b94f instantiate_class_template_1 ../../gcc-4.8.2/gcc/cp/pt.c:9030 0x52b94f
instantiate_class_template(tree_node*) ../../gcc-4.8.2/gcc/cp/pt.c:9088
0x57993d complete_type(tree_node*) ../../gcc-4.8.2/gcc/cp/typeck.c:131 0x51d448
tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
../../gcc-4.8.2/gcc/cp/pt.c:14552 0x592618 perform_member_init
../../gcc-4.8.2/gcc/cp/init.c:538 0x592618 emit_mem_initializers(tree_node*)
../../gcc-4.8.2/gcc/cp/init.c:1109 0x596976 synthesize_method(tree_node*)
../../gcc-4.8.2/gcc/cp/method.c:796 0x54367a mark_used(tree_node*)
../../gcc-4.8.2/gcc/cp/decl2.c:4677 0x4f01ec build_over_call
../../gcc-4.8.2/gcc/cp/call.c:7055 0x4ed698 build_new_method_call_1
../../gcc-4.8.2/gcc/cp/call.c:7715 0x4ed698 build_new_method_call(tree_node*,
tree_node*, vec<tree_node*, va_gc, vl_embed>**, tree_node*, int, tree_node**,
int) ../../gcc-4.8.2/gcc/cp/call.c:7785 0x4edf3e
build_special_member_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, int) ../../gcc-4.8.2/gcc/cp/call.c:7352 0x58fec5
expand_default_init ../../gcc-4.8.2/gcc/cp/init.c:1679 0x58fec5
expand_aggr_init_1 ../../gcc-4.8.2/gcc/cp/init.c:1780 0x591a08
build_aggr_init(tree_node*, tree_node*, int, int)
../../gcc-4.8.2/gcc/cp/init.c:1531 0x4fcd9c build_aggr_init_full_exprs
../../gcc-4.8.2/gcc/cp/decl.c:5543 0x4fcd9c check_initializer
../../gcc-4.8.2/gcc/cp/decl.c:5678 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."
>From gcc-bugs-return-452864-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri May 30 15:10:14 2014
Return-Path: <gcc-bugs-return-452864-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 694 invoked by alias); 30 May 2014 15:10:13 -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 581 invoked by uid 55); 30 May 2014 15:10:04 -0000
From: "jason at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/56947] [4.7 Regression] Bogus 'XX' was not declared in this scope
Date: Fri, 30 May 2014 15:10:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.7.3
X-Bugzilla-Keywords: rejects-valid
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jason at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P1
X-Bugzilla-Assigned-To: jason at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.7.4
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-56947-4-99ekvRQFej@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-56947-4@http.gcc.gnu.org/bugzilla/>
References: <bug-56947-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/msg02556.txt.bz2
Content-length: 521

https://gcc.gnu.org/bugzilla/show_bug.cgi?idV947

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Fri May 30 15:09:29 2014
New Revision: 211083

URL: http://gcc.gnu.org/viewcvs?rev!1083&root=gcc&view=rev
Log:
    PR c++/56947
    * pt.c (instantiate_decl): Don't defer instantiation of a nested
    function.

Added:
    branches/gcc-4_7-branch/gcc/testsuite/g++.dg/template/local8.C
Modified:
    branches/gcc-4_7-branch/gcc/cp/ChangeLog
    branches/gcc-4_7-branch/gcc/cp/pt.c


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/61362] g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2 does not compile lambda with template
  2014-05-29 22:00 [Bug c++/61362] New: g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2 does not compile lambda with template dgront at chem dot uw.edu.pl
  2014-05-29 22:01 ` [Bug c++/61362] " dgront at chem dot uw.edu.pl
  2014-05-30 15:07 ` daniel.kruegler at googlemail dot com
@ 2014-05-30 15:14 ` daniel.kruegler at googlemail dot com
  2014-06-26 17:10 ` paolo.carlini at oracle dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2014-05-30 15:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61362

--- Comment #2 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
Reduced example (removing library dependencies) using compiler flags

 -Wall -Wextra -std=c++11 -pedantic 

for gcc HEAD 4.10.0 20140529 (experimental)

//---------------------
struct function {
  template<class F>
  function(F){}

  void operator()(...) {}
};

struct Node {
  unsigned length;
};

template<typename N>
class C {
public:
  unsigned longest = 0;
  function f = [this](N node) {
    if(node->length > this->longest) this->longest = node->length;
  };
};

int main() {
  Node n;
  n.length = 5;
  C<Node*> c;
  c.f(&n);
}
//---------------------

results in

"prog.cc: In instantiation of 'C<N>::<lambda(N)> [with N = Node*]':
prog.cc:16:17: required from 'struct C<Node*>::<lambda(struct Node*)>'
prog.cc:24:12: required from here prog.cc:16:29: internal compiler error:
Segmentation fault function f = [this](N node) { ^ 0x96976f crash_signal
/home/heads/gcc/gcc-source/gcc/toplev.c:337 0x56ddb5
instantiate_decl(tree_node*, int, bool)
/home/heads/gcc/gcc-source/gcc/cp/pt.c:19932 0x5802b1
instantiate_class_template_1 /home/heads/gcc/gcc-source/gcc/cp/pt.c:9367
0x5802b1 instantiate_class_template(tree_node*)
/home/heads/gcc/gcc-source/gcc/cp/pt.c:9435 0x5d726d complete_type(tree_node*)
/home/heads/gcc/gcc-source/gcc/cp/typeck.c:134 0x567644
tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
/home/heads/gcc/gcc-source/gcc/cp/pt.c:15327 0x5ec715 get_nsdmi(tree_node*,
bool) /home/heads/gcc/gcc-source/gcc/cp/init.c:543 0x5f4bf4 walk_field_subobs
/home/heads/gcc/gcc-source/gcc/cp/method.c:1098 0x5f53bc
synthesized_method_walk /home/heads/gcc/gcc-source/gcc/cp/method.c:1424
0x5f64b5 get_defaulted_eh_spec(tree_node*)
/home/heads/gcc/gcc-source/gcc/cp/method.c:1455 0x581707
maybe_instantiate_noexcept(tree_node*)
/home/heads/gcc/gcc-source/gcc/cp/pt.c:19563 0x599ae7 mark_used(tree_node*,
int) /home/heads/gcc/gcc-source/gcc/cp/decl2.c:4823 0x537459 build_over_call
/home/heads/gcc/gcc-source/gcc/cp/call.c:7325 0x53de3a build_new_method_call_1
/home/heads/gcc/gcc-source/gcc/cp/call.c:8037 0x53de3a
build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, tree_node**, int)
/home/heads/gcc/gcc-source/gcc/cp/call.c:8107 0x53e6e6
build_special_member_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, int)
/home/heads/gcc/gcc-source/gcc/cp/call.c:7651 0x5ef036 expand_default_init
/home/heads/gcc/gcc-source/gcc/cp/init.c:1713 0x5ef036 expand_aggr_init_1
/home/heads/gcc/gcc-source/gcc/cp/init.c:1814 0x5f096e
build_aggr_init(tree_node*, tree_node*, int, int)
/home/heads/gcc/gcc-source/gcc/cp/init.c:1566 0x549a2d
build_aggr_init_full_exprs /home/heads/gcc/gcc-source/gcc/cp/decl.c:5642 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."
>From gcc-bugs-return-452868-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri May 30 15:39:58 2014
Return-Path: <gcc-bugs-return-452868-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 22599 invoked by alias); 30 May 2014 15:39:58 -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 22558 invoked by uid 48); 30 May 2014 15:39:54 -0000
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/36183] misleading error message with explicit copy constructor call
Date: Fri, 30 May 2014 15:39:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.2.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: manu at gcc dot gnu.org
X-Bugzilla-Status: NEW
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_status cf_reconfirmed_on cc everconfirmed bug_severity
Message-ID: <bug-36183-4-YGArSAezWA@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-36183-4@http.gcc.gnu.org/bugzilla/>
References: <bug-36183-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/msg02560.txt.bz2
Content-length: 1214

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36183

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-05-30
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |manu at gcc dot gnu.org
     Ever confirmed|0                           |1
           Severity|trivial                     |normal

--- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
It seems to me that the problem is the "explicit" keyword, so an error like:

test.cc:14:6: error: no matching function for call to ‘B::B(const B&)’
   f(b); // error: no matching function for call to 'B::B(const B&)'
      ^
test.cc:4:3: note: candidate: 'explicit B::B(const B&)'
   B() {}
   ^
test.cc:4:3: note:   is marked as explicit but implicit conversion required
test.cc:8:6: note:   initializing argument 1 of ‘void f(B)’
 void f(B obj) {}
      ^

Jason?
>From gcc-bugs-return-452869-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri May 30 15:46:01 2014
Return-Path: <gcc-bugs-return-452869-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 27085 invoked by alias); 30 May 2014 15:46:01 -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 27039 invoked by uid 48); 30 May 2014 15:45:58 -0000
From: "crrodriguez at opensuse dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug preprocessor/61371] New: cpp: Implement -fno-date-time/-freproducible-dates or similar
Date: Fri, 30 May 2014 15:46:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: preprocessor
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: crrodriguez at opensuse 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-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter
Message-ID: <bug-61371-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/msg02561.txt.bz2
Content-length: 1336

https://gcc.gnu.org/bugzilla/show_bug.cgi?ida371

            Bug ID: 61371
           Summary: cpp: Implement -fno-date-time/-freproducible-dates or
                    similar
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: crrodriguez at opensuse dot org

Hi:

Current releases have the option to warn/err on the use of __DATE__ , __TIME__
and __TIMESTAMP__, first thanks for implementing this as it is a good step to
aid reproducible builds. That said, it is unfortunately still quite
inconvenient for large scale projects such as distributions because it requires
going through hundreds or thousands of packages.

I suggest a command line option to be implemented such as

-fno-date-time
-freproducible-dates

Or whatever other appropriate name that behaves in one of this ways:

Either:

- __DATE__, __TIME__ and __TIMESTAMP__ expand as  "If GCC cannot determine the
current date" (that is ???...)

- __DATE__ and __TIME__ expand to the file 's  last modification time

- Whatever other sane alternative that ensures different builds of the same
source code and same preprocessor/compiler/linker options result in identical
builds.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/61362] g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2 does not compile lambda with template
  2014-05-29 22:00 [Bug c++/61362] New: g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2 does not compile lambda with template dgront at chem dot uw.edu.pl
                   ` (2 preceding siblings ...)
  2014-05-30 15:14 ` daniel.kruegler at googlemail dot com
@ 2014-06-26 17:10 ` paolo.carlini at oracle dot com
  2015-03-07 10:46 ` thibaut.lutz at googlemail dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-06-26 17:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61362

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-06-26
             Blocks|                            |54367
     Ever confirmed|0                           |1
           Severity|major                       |normal


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/61362] g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2 does not compile lambda with template
  2014-05-29 22:00 [Bug c++/61362] New: g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2 does not compile lambda with template dgront at chem dot uw.edu.pl
                   ` (3 preceding siblings ...)
  2014-06-26 17:10 ` paolo.carlini at oracle dot com
@ 2015-03-07 10:46 ` thibaut.lutz at googlemail dot com
  2015-10-11 19:32 ` ville.voutilainen at gmail dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: thibaut.lutz at googlemail dot com @ 2015-03-07 10:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61362

Thibaut LUTZ <thibaut.lutz at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thibaut.lutz at googlemail dot com

--- Comment #3 from Thibaut LUTZ <thibaut.lutz at googlemail dot com> ---
This triggers the same internal error on HEAD 5.0.0 20150306.


>>>>>>
template <typename>
struct S {
  int f{[this](){return 42;}()};
};

int main(){
  return S<int>{}.f; // should be 42
}
<<<<<<

prog.cc: In instantiation of 'struct S<int>::<lambda()>':
prog.cc:3:29:   required from here
prog.cc:3:10: internal compiler error: in tsubst_copy, at cp/pt.c:12872
  int f{[this](){return 42;}()};


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/61362] g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2 does not compile lambda with template
  2014-05-29 22:00 [Bug c++/61362] New: g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2 does not compile lambda with template dgront at chem dot uw.edu.pl
                   ` (4 preceding siblings ...)
  2015-03-07 10:46 ` thibaut.lutz at googlemail dot com
@ 2015-10-11 19:32 ` ville.voutilainen at gmail dot com
  2015-10-11 19:41 ` ville.voutilainen at gmail dot com
  2015-10-12 10:53 ` thibaut.lutz at googlemail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: ville.voutilainen at gmail dot com @ 2015-10-11 19:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61362

Ville Voutilainen <ville.voutilainen at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ville.voutilainen at gmail dot com

--- Comment #4 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
None of the examples ICE on the current trunk I have on Linux-X64. Can anyone
else verify whether the ICEs can still be triggered?


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/61362] g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2 does not compile lambda with template
  2014-05-29 22:00 [Bug c++/61362] New: g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2 does not compile lambda with template dgront at chem dot uw.edu.pl
                   ` (5 preceding siblings ...)
  2015-10-11 19:32 ` ville.voutilainen at gmail dot com
@ 2015-10-11 19:41 ` ville.voutilainen at gmail dot com
  2015-10-12 10:53 ` thibaut.lutz at googlemail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: ville.voutilainen at gmail dot com @ 2015-10-11 19:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61362

--- Comment #5 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
Oh, some crash with -std=c++1z but not with the current default of -std=c++14.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/61362] g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2 does not compile lambda with template
  2014-05-29 22:00 [Bug c++/61362] New: g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2 does not compile lambda with template dgront at chem dot uw.edu.pl
                   ` (6 preceding siblings ...)
  2015-10-11 19:41 ` ville.voutilainen at gmail dot com
@ 2015-10-12 10:53 ` thibaut.lutz at googlemail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: thibaut.lutz at googlemail dot com @ 2015-10-12 10:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61362

--- Comment #6 from Thibaut LUTZ <thibaut.lutz at googlemail dot com> ---
My previous test cases still fails with 6.0.0 20151012 on linux64.
It passes with "-std=c++11".
Fails with "-std=c++14", "-std=c++17", "-std=c++1y".

Same error:
prog.cc: In instantiation of ‘struct S<int>::<lambda()>’:
prog.cc:3:29:   required from here
prog.cc:3:10: internal compiler error: in tsubst_copy, at cp/pt.c:13708
   int f{[this](){return 42;}()};
>From gcc-bugs-return-499313-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Oct 12 10:57:31 2015
Return-Path: <gcc-bugs-return-499313-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 19354 invoked by alias); 12 Oct 2015 10:57:31 -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 19331 invoked by uid 48); 12 Oct 2015 10:57:27 -0000
From: "ktkachov at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/67929] New: [4.9/5/6 Regression][arm] Wrong code for FP mult-by-power-of-2 + int conversion
Date: Mon, 12 Oct 2015 10:57:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ktkachov at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
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 keywords bug_severity priority component assigned_to reporter target_milestone cf_gcctarget
Message-ID: <bug-67929-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: 2015-10/txt/msg00868.txt.bz2
Content-length: 1044

https://gcc.gnu.org/bugzilla/show_bug.cgi?idg929

            Bug ID: 67929
           Summary: [4.9/5/6 Regression][arm] Wrong code for FP
                    mult-by-power-of-2 + int conversion
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ktkachov at gcc dot gnu.org
  Target Milestone: ---
            Target: arm*

Testcase:

int
foo (float a)
{
  return a * 4.9f;
}


int
main (void)
{
  if (foo (10.0f) != 49)
    __builtin_abort ();

  return 0;
}

Compiled with -Ofast -mfpu=vfpv3 -mfloat-abi=hard -mcpu=cortex-a15 -fno-inline
aborts.

The problem is foo (10.0f) returns 40.
This is because the combine_vcvtf2i triggers where its predicate should have
rejected 4.9f

The vfp3_const_double_for_bits function in arm.c is too liberal and accepts any
FP constant that, when truncated, evaluates to a power of 2 FP constant.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-10-12 10:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-29 22:00 [Bug c++/61362] New: g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2 does not compile lambda with template dgront at chem dot uw.edu.pl
2014-05-29 22:01 ` [Bug c++/61362] " dgront at chem dot uw.edu.pl
2014-05-30 15:07 ` daniel.kruegler at googlemail dot com
2014-05-30 15:14 ` daniel.kruegler at googlemail dot com
2014-06-26 17:10 ` paolo.carlini at oracle dot com
2015-03-07 10:46 ` thibaut.lutz at googlemail dot com
2015-10-11 19:32 ` ville.voutilainen at gmail dot com
2015-10-11 19:41 ` ville.voutilainen at gmail dot com
2015-10-12 10:53 ` thibaut.lutz at googlemail dot com

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).