Bug 52743 - g++-4.7.0 seg faults on overload functions.
Summary: g++-4.7.0 seg faults on overload functions.
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: 4.7.1
Assignee: Jason Merrill
URL:
Keywords:
: 52951 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-03-27 19:05 UTC by rigaje
Modified: 2012-04-13 18:23 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2012-03-29 00:00:00


Attachments
source code causing the seg fault (85 bytes, text/x-c++src)
2012-03-27 19:05 UTC, rigaje
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rigaje 2012-03-27 19:05:28 UTC
Created attachment 27016 [details]
source code causing the seg fault

void composite (int const (&) [2]);
void composite (int const (&) [3]);

int main ()
{
 composite({0,1});

 return 0;
}

compiled with :
$HOME/gcc/4.7.0/bin/c++ -v -save-temps -std=c++0x -Wall -Wextra -fno-strict-aliasing -fwrapv -O2 main.cc

output from g++-4.7.0 is :
Reading specs from /home/meng/gcc/4.7.0/lib/gcc/i686-pc-linux-gnu/4.7.0/specs
COLLECT_GCC=/home/meng/gcc/4.7.0/bin/c++
COLLECT_LTO_WRAPPER=/home/meng/gcc/4.7.0/libexec/gcc/i686-pc-linux-gnu/4.7.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ./configure --prefix=/home/meng/gcc/4.7.0/ --enable-languages=c,c++
Thread model: posix
gcc version 4.7.0 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++11' '-Wall' '-Wextra' '-fno-strict-aliasing' '-fwrapv' '-O2' '-shared-libgcc' '-mtune=generic' '-march=pentiumpro'
 /home/meng/gcc/4.7.0/libexec/gcc/i686-pc-linux-gnu/4.7.0/cc1plus -E -quiet -v -D_GNU_SOURCE main.cc -mtune=generic -march=pentiumpro -std=c++11 -Wall -Wextra -fno-strict-aliasing -fwrapv -O2 -fpch-preprocess -o main.ii
ignoring nonexistent directory "/home/meng/gcc/4.7.0/lib/gcc/i686-pc-linux-gnu/4.7.0/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/meng/gcc/4.7.0/lib/gcc/i686-pc-linux-gnu/4.7.0/../../../../include/c++/4.7.0
 /home/meng/gcc/4.7.0/lib/gcc/i686-pc-linux-gnu/4.7.0/../../../../include/c++/4.7.0/i686-pc-linux-gnu
 /home/meng/gcc/4.7.0/lib/gcc/i686-pc-linux-gnu/4.7.0/../../../../include/c++/4.7.0/backward
 /home/meng/gcc/4.7.0/lib/gcc/i686-pc-linux-gnu/4.7.0/include
 /usr/local/include
 /home/meng/gcc/4.7.0/include
 /home/meng/gcc/4.7.0/lib/gcc/i686-pc-linux-gnu/4.7.0/include-fixed
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++11' '-Wall' '-Wextra' '-fno-strict-aliasing' '-fwrapv' '-O2' '-shared-libgcc' '-mtune=generic' '-march=pentiumpro'
 /home/meng/gcc/4.7.0/libexec/gcc/i686-pc-linux-gnu/4.7.0/cc1plus -fpreprocessed main.ii -quiet -dumpbase main.cc -mtune=generic -march=pentiumpro -auxbase main -O2 -Wall -Wextra -std=c++11 -version -fno-strict-aliasing -fwrapv -o main.s
GNU C++ (GCC) version 4.7.0 (i686-pc-linux-gnu)
	compiled by GNU C version 4.7.0, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++ (GCC) version 4.7.0 (i686-pc-linux-gnu)
	compiled by GNU C version 4.7.0, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 25995eec1d8a7c765ef4a29ef128f2c2
main.cc: In function ‘int main()’:
main.cc:6:17: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Jason Merrill 2012-03-29 14:14:07 UTC
Author: jason
Date: Thu Mar 29 14:14:00 2012
New Revision: 185963

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=185963
Log:
	PR c++/52743
	* call.c (compare_ics): Handle ck_aggr like ck_list.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/initlist-array3.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/call.c
    trunk/gcc/testsuite/ChangeLog
Comment 2 Jason Merrill 2012-03-29 14:45:17 UTC
Author: jason
Date: Thu Mar 29 14:45:09 2012
New Revision: 185964

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=185964
Log:
	PR c++/52743
	* call.c (compare_ics): Handle ck_aggr like ck_list.

Added:
    branches/gcc-4_7-branch/gcc/testsuite/g++.dg/cpp0x/initlist-array3.C
Modified:
    branches/gcc-4_7-branch/gcc/cp/ChangeLog
    branches/gcc-4_7-branch/gcc/cp/call.c
    branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
Comment 3 Jason Merrill 2012-03-29 14:46:43 UTC
Fixed.
Comment 4 D W 2012-04-13 18:23:19 UTC
*** Bug 52951 has been marked as a duplicate of this bug. ***