public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60708] New: An array temporary causes an ICE in gimplify
@ 2014-03-30 13:29 ville.voutilainen at gmail dot com
  2014-03-31  8:24 ` [Bug c++/60708] [4.8/4.9 Regression] " rguenth at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: ville.voutilainen at gmail dot com @ 2014-03-30 13:29 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60708

            Bug ID: 60708
           Summary: An array temporary causes an ICE in gimplify
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ville.voutilainen at gmail dot com

Test:

template <class T, class U> struct mypair {
  mypair(T, U) {}
};

template <class T, class U> auto my_make_pair(T t, U u)
{
  return mypair<T, U>(t, u);
}

template<typename T> struct S {
 mypair<T *, int> get_pair() noexcept { 
   return my_make_pair((T*)nullptr, 0); 
 } 
}; 

static void foo(const mypair<char *, int> (&a)[2]) noexcept { } 

int main()
{ 
  S<char> s; 
  //mypair<char*, int> jones[2]{s.get_pair(), s.get_pair()};
  //foo(jones);
  foo({s.get_pair(), s.get_pair()}); 
}

If the commented lines are present, this compiles fine. I don't know why,
because with the code as written, the following explosion happens:

lhcat2.cpp: In function ‘int main()’:
lhcat2.cpp:24:35: internal compiler error: Segmentation fault
   foo({s.get_pair(), s.get_pair()}); 
                                   ^
0xb50aff crash_signal
    ../../gcc/toplev.c:337
0x9b590d gimplify_target_expr
    ../../gcc/gimplify.c:5255
0x9a2d2c gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
    ../../gcc/gimplify.c:7815
0x9ac27d gimplify_addr_expr
    ../../gcc/gimplify.c:4801
0x9a2935 gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
    ../../gcc/gimplify.c:7494
0x9acdb8 gimplify_call_expr
    ../../gcc/gimplify.c:2375
0x9a24c7 gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
    ../../gcc/gimplify.c:7419
0x9a6e16 gimplify_stmt(tree_node**, gimple_statement_base**)
    ../../gcc/gimplify.c:5341
0x9a2552 gimplify_cleanup_point_expr
    ../../gcc/gimplify.c:5117
0x9a2552 gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
    ../../gcc/gimplify.c:7811
0x9a6e16 gimplify_stmt(tree_node**, gimple_statement_base**)
    ../../gcc/gimplify.c:5341
0x9a2fdb gimplify_statement_list
    ../../gcc/gimplify.c:1412
0x9a2fdb gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
    ../../gcc/gimplify.c:7863
0x9a6e16 gimplify_stmt(tree_node**, gimple_statement_base**)
    ../../gcc/gimplify.c:5341
0x9a7b1f gimplify_bind_expr
    ../../gcc/gimplify.c:1079
0x9a2a0e gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
    ../../gcc/gimplify.c:7645
0x9a6e16 gimplify_stmt(tree_node**, gimple_statement_base**)
    ../../gcc/gimplify.c:5341
0x9a2fdb gimplify_statement_list
    ../../gcc/gimplify.c:1412
0x9a2fdb gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
    ../../gcc/gimplify.c:7863
0x9a6e16 gimplify_stmt(tree_node**, gimple_statement_base**)
    ../../gcc/gimplify.c:5341
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-447831-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Mar 30 13:31:27 2014
Return-Path: <gcc-bugs-return-447831-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 27036 invoked by alias); 30 Mar 2014 13:31:26 -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 27007 invoked by uid 48); 30 Mar 2014 13:31:23 -0000
From: "frankhb1989 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/60709] New: [C++11]ICE when using a braced-init-list as function argument to initialize a reference to array
Date: Sun, 30 Mar 2014 13:31: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-Version: 4.8.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: frankhb1989 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-60709-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-03/txt/msg02700.txt.bz2
Content-length: 943

http://gcc.gnu.org/bugzilla/show_bug.cgi?id`709

            Bug ID: 60709
           Summary: [C++11]ICE when using a braced-init-list as function
                    argument to initialize a reference to array
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: frankhb1989 at gmail dot com

Minimal case:

template<class T>
struct X{};

void f(X<int>(&&)[1])
{}
int main()
{
  f({X<int>()});
}

g++ a.cc -std=c++11
a.cc: In function 'int main()':
a.cc:8:15: internal compiler error: Segmentation fault
   f({X<int>()});
               ^
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://sourceforge.net/projects/mingw-w64> for instructions.

Clang++ 3.4 accepted it successfully.


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

end of thread, other threads:[~2014-05-13 16:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-30 13:29 [Bug c++/60708] New: An array temporary causes an ICE in gimplify ville.voutilainen at gmail dot com
2014-03-31  8:24 ` [Bug c++/60708] [4.8/4.9 Regression] " rguenth at gcc dot gnu.org
2014-03-31  8:24 ` rguenth at gcc dot gnu.org
2014-03-31  8:27 ` ville.voutilainen at gmail dot com
2014-03-31 12:54 ` ville.voutilainen at gmail dot com
2014-04-01 18:10 ` jason at gcc dot gnu.org
2014-04-01 19:14 ` jason at gcc dot gnu.org
2014-04-01 19:17 ` [Bug c++/60708] [4.8 " jason at gcc dot gnu.org
2014-05-13 16:05 ` jason at gcc dot gnu.org
2014-05-13 16:07 ` jason at gcc dot gnu.org

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