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

Markus Trippelsdorf <markus at trippelsdorf dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |markus at trippelsdorf dot
                   |                            |de

--- Comment #4 from Markus Trippelsdorf <markus at trippelsdorf dot de> 
2012-09-07 11:56:34 UTC ---
gcc-4.7 and 4.8 are also affected.

markus@x4 tmp % cat test.ii
template < typename T > T h2le (T)
{
    T a;
    unsigned short &b = a;
    short c = 0;
    unsigned char (&d)[2] = reinterpret_cast < unsigned char (&)[2] > (c);
    unsigned char (&e)[2] = reinterpret_cast < unsigned char (&)[2] > (b);
    e[0] = d[0];
    return a;
}

void
bar ()
{
    h2le ((unsigned short) 0);
}

markus@x4 tmp % gdb /var/tmp/foo/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.0/g++
Reading symbols from
/var/tmp/foo/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.0/g++...done.
(gdb) run -c -O2 -std=c++0x test.ii
Starting program: /var/tmp/foo/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.0/g++ -c -O2
-std=c++0x test.ii
warning: no loadable sections found in added symbol-file system-supplied DSO at
0x7ffff7ffa000
[New process 18282]
process 18282 is executing new program:
/var/tmp/foo/usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.0/cc1plus

Program received signal SIGSEGV, Segmentation fault.
[Switching to process 18282]
0x00000000008b5803 in disqualify_base_of_expr(tree_node*, char const*) () at
../../gcc/gcc/tree-sra.c:987
987     ../../gcc/gcc/tree-sra.c: No such file or directory.
(gdb) bt
#0  0x00000000008b5803 in disqualify_base_of_expr(tree_node*, char const*) ()
at ../../gcc/gcc/tree-sra.c:987
#1  0x00000000008b6eb5 in build_access_from_expr_1(tree_node*,
gimple_statement_d*, bool) () at ../../gcc/gcc/tree-sra.c:1025
#2  0x00000000008b74ab in scan_function() () at ../../gcc/gcc/tree-sra.c:1119
#3  0x00000000008bb622 in ipa_early_sra() () at ../../gcc/gcc/tree-sra.c:4814
#4  0x00000000007ca012 in execute_one_pass(opt_pass*) () at
../../gcc/gcc/passes.c:2158
#5  0x00000000007ca385 in execute_pass_list(opt_pass*) () at
../../gcc/gcc/passes.c:2213
#6  0x00000000007ca397 in execute_pass_list(opt_pass*) () at
../../gcc/gcc/passes.c:2214
#7  0x00000000007c95fd in do_per_function_toporder(void (*)(void*), void*) ()
at ../../gcc/gcc/passes.c:1702
#8  0x00000000007ca7ec in execute_ipa_pass_list(opt_pass*) () at
../../gcc/gcc/passes.c:2527
#9  0x000000000064f758 in compile() ()
#10 0x000000000064fb15 in finalize_compilation_unit() ()
#11 0x0000000000528a57 in cp_write_global_declarations() () at
../../gcc/gcc/cp/decl2.c:4024
#12 0x000000000085a565 in compile_file() ()
#13 0x000000000085bd5a in toplev_main(int, char**) ()
#14 0x00007ffff74ef755 in __libc_start_main () from /lib/libc.so.6
#15 0x00000000004c8249 in _start ()

Reply via email to