public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61351] New: ICE on valid when deducing template arguments with nested expansions of the same pack
@ 2014-05-29  1:22 richard-gccbugzilla at metafoo dot co.uk
  2014-12-14 14:21 ` [Bug c++/61351] " ville.voutilainen at gmail dot com
  0 siblings, 1 reply; 2+ messages in thread
From: richard-gccbugzilla at metafoo dot co.uk @ 2014-05-29  1:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61351
           Summary: ICE on valid when deducing template arguments with
                    nested expansions of the same pack
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: richard-gccbugzilla at metafoo dot co.uk

Testcase:

  template<class ...T> struct X {};
  template<class ...T> void foo(X<T, T...>... a);
  void test() { foo(X<int, int, double>(), X<double, int, double>()); }

Result in:

<stdin>: In substitution of ‘template<class ... T> void foo(X<T, T ...>...)
[with T = <missing>]’:
<stdin>:10:56:   required from here
<stdin>:10:56: internal compiler error: tree check: expected class
‘expression’, have ‘type’ (integer_type) in tree_operand_check, at tree.h:3146
0xd66c27 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ../../src/gcc/tree.c:9243
0x4f4bdb expr_check
        ../../src/gcc/tree.h:2882
0x4f4bdb tree_operand_check
        ../../src/gcc/tree.h:3146
0x5dd069 tree_operand_check
        ../../src/gcc/tree.h:2713
0x5dd069 unify_pack_expansion
        ../../src/gcc/cp/pt.c:17119
0x5d9c2c unify
        ../../src/gcc/cp/pt.c:17906
0x5d7d63 unify
        ../../src/gcc/cp/pt.c:17802
0x5d89b6 unify
        ../../src/gcc/cp/pt.c:17898
0x4f4fe9 try_class_unification
        ../../src/gcc/cp/pt.c:16913
0x5d7ea9 unify
        ../../src/gcc/cp/pt.c:17934
0x5db637 unify_one_argument
        ../../src/gcc/cp/pt.c:16338
0x5dc680 unify_pack_expansion
        ../../src/gcc/cp/pt.c:17151
0x5ddf6a type_unification_real
        ../../src/gcc/cp/pt.c:16430
0x5e679a fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, bool, bool)
        ../../src/gcc/cp/pt.c:15848
0x552801 add_template_candidate_real
        ../../src/gcc/cp/call.c:2974
0x54e4dc add_template_candidate
        ../../src/gcc/cp/call.c:3071
0x54e4dc add_candidates
        ../../src/gcc/cp/call.c:5136
0x554909 perform_overload_resolution
        ../../src/gcc/cp/call.c:3871
0x55792a build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, bool, int)
        ../../src/gcc/cp/call.c:3948
0x6d6fc4 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
        ../../src/gcc/cp/semantics.c:2355
>From gcc-bugs-return-452779-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu May 29 01:46:51 2014
Return-Path: <gcc-bugs-return-452779-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 32713 invoked by alias); 29 May 2014 01:46:50 -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 32600 invoked by uid 48); 29 May 2014 01:46:40 -0000
From: "scovich at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/14932] [3.4/4.0 Regression] cannot use offsetof to get offsets of array elements in g++ 3.4.0 prerelease
Date: Thu, 29 May 2014 01:46: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: 3.4.0
X-Bugzilla-Keywords: patch, rejects-valid
X-Bugzilla-Severity: normal
X-Bugzilla-Who: scovich at gmail dot com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: giovannibajo at gmail dot com
X-Bugzilla-Target-Milestone: 3.4.1
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-14932-4-gxnZRA5Jry@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-14932-4@http.gcc.gnu.org/bugzilla/>
References: <bug-14932-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/msg02471.txt.bz2
Content-length: 1007

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

Ryan Johnson <scovich at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |scovich at gmail dot com

--- Comment #16 from Ryan Johnson <scovich at gmail dot com> ---
A very similar problem arises with gcc-4.8.2 (and 4.9.0):

#include <stdio.h>
struct foo {
    char data[10];
};
int main() {
    int x = 4;
    printf("%zd\n", offsetof(struct foo, data[x]));
    return 0;
}


gcc-4.8.2 accepts it (with -xc), as does clang-3.0. In both cases, the
resulting binary prints "4" as expected. g++-4.8.2 rejects:

bug.cpp: In function ‘int main()’:
bug.cpp:9:47: error: ‘x’ cannot appear in a constant-expression
     printf("%zd\n", offsetof(struct foo, data[x]));

So again, I don't think this bug is fixed... but I'll happily file a new PR if
that's preferred.
>From gcc-bugs-return-452780-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu May 29 02:28:58 2014
Return-Path: <gcc-bugs-return-452780-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 8849 invoked by alias); 29 May 2014 02:28:57 -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 8810 invoked by uid 48); 29 May 2014 02:28:50 -0000
From: "howarth.at.gcc at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/61352] New: gcc 4.9.0 debug code confuses gdb 7.7.1 on darwin11/12 but not gcc 4.8.3 debug code
Date: Thu, 29 May 2014 02:28:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: debug
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: howarth.at.gcc 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-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter
Message-ID: <bug-61352-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/msg02472.txt.bz2
Content-length: 3447

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

            Bug ID: 61352
           Summary: gcc 4.9.0 debug code confuses gdb 7.7.1 on darwin11/12
                    but not gcc 4.8.3 debug code
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: howarth.at.gcc at gmail dot com

The new gdb 7.7.1 release, which works normally on both x86_64-apple-darwin11
and x86_64-apple-darwin12 (but still has issues with x86_64-apple-darwin13)
fails to step through code properly for binaries generated from gcc 4.9.0. For
example…

% gcc-fsf-4.9 -g -O1 himenoBMTxpa.c -o himenoBMTxpa
% sudo fsf-gdb ./himenoBMTxpa
GNU gdb (GDB) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin12.5.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./himenoBMTxpa...
warning: dsym file UUID doesn't match the one in /Users/howarth/himenoBMTxpa

warning: `/var/folders/1l/n78sywl52lz6kkys6nv7mnph0000gp/T//ccO87jsA.o': can't
open to read symbols: No such file or directory.
(no debugging symbols found)...done.
(gdb) break main
Breakpoint 1 at 0x1000014ef
(gdb) r
Starting program: /Users/howarth/himenoBMTxpa 
Breakpoint 1, 0x00000001000014ef in main ()
(gdb) s
Single stepping until exit from function main,
which has no line number information.
For example: 
 Grid-size= XS (32x32x64)
        S  (64x64x128)
        M  (128x128x256)
        L  (256x256x512)
        XL (512x512x1024)

Grid-size = 

whereas with gcc 4.8.3…

% gcc-fsf-4.8 -g -O1 himenoBMTxpa.c -o himenoBMTxpa
% sudo fsf-gdb ./himenoBMTxpa
GNU gdb (GDB) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin12.5.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./himenoBMTxpa...Reading symbols from
/Users/howarth/himenoBMTxpa.dSYM/Contents/Resources/DWARF/himenoBMTxpa...done.
done.
(gdb) break main
Breakpoint 1 at 0x100001500: file himenoBMTxpa.c, line 71.
(gdb) r
Starting program: /Users/howarth/himenoBMTxpa 

Breakpoint 1, main (argc=1, argv=0x7fff5fbff7d0) at himenoBMTxpa.c:71
71    {
(gdb) s
78      if(argc == 2){
(gdb)
>From gcc-bugs-return-452781-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu May 29 02:40:53 2014
Return-Path: <gcc-bugs-return-452781-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 14158 invoked by alias); 29 May 2014 02:40:51 -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 14040 invoked by uid 48); 29 May 2014 02:40:39 -0000
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/61352] gcc 4.9.0 debug code confuses gdb 7.7.1 on darwin11/12 but not gcc 4.8.3 debug code
Date: Thu, 29 May 2014 02:40:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: debug
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pinskia at gcc dot gnu.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:
Message-ID: <bug-61352-4-hxiBq1AUQH@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61352-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61352-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/msg02473.txt.bz2
Content-length: 221

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Try using a non temporary .o file.  This is darwin not storing the debugging
info in the executable.


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

* [Bug c++/61351] ICE on valid when deducing template arguments with nested expansions of the same pack
  2014-05-29  1:22 [Bug c++/61351] New: ICE on valid when deducing template arguments with nested expansions of the same pack richard-gccbugzilla at metafoo dot co.uk
@ 2014-12-14 14:21 ` ville.voutilainen at gmail dot com
  0 siblings, 0 replies; 2+ messages in thread
From: ville.voutilainen at gmail dot com @ 2014-12-14 14:21 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-12-14
                 CC|                            |ville.voutilainen at gmail dot com
     Ever confirmed|0                           |1
      Known to fail|                            |4.8.2, 4.9.1, 5.0

--- Comment #1 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
Clang accepts the code.


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

end of thread, other threads:[~2014-12-14 14:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-29  1:22 [Bug c++/61351] New: ICE on valid when deducing template arguments with nested expansions of the same pack richard-gccbugzilla at metafoo dot co.uk
2014-12-14 14:21 ` [Bug c++/61351] " ville.voutilainen at gmail 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).