I'm getting the following segfault when I compile the beep-media-player application with the options -ffast-math -funroll-all-loops -g -O3: visualization.c: In function 'vis_send_data': visualization.c:270: internal compiler error: Segmentation fault Please submit a full bug report, The problem is that this segfault doesn't happen with the preprocessed source, so I've no idea how to report this properly. Any hints on this?
g_bit_nth_lsf g_bit_nth_msf g_bit_storage g_trash_stack_push g_trash_stack_pop g_trash_stack_peek g_t rash_stack_height g_string_append_c_inline strtod strtol strtoul strtoq strtouq strtoll strtoull atof atoi atol atoll gnu_dev_major {GC 5331k -> 4258k} gnu_dev_minor gnu_dev_makedev __strcspn_c1 __strcspn _c2 __strcspn_c3 __strspn_c1 __strspn_c2 __strspn_c3 __strpbrk_c2 __strpbrk_c3 __strtok_r_1c __strsep_ 1c __strsep_2c __strsep_3c {GC 5536k -> 5068k} {GC 6589k -> 6224k} vprintf getchar getc_unlocked getch ar_unlocked putchar fputc_unlocked putc_unlocked putchar_unlocked feof_unlocked ferror_unlocked {GC 80 95k -> 7683k} {GC 9991k -> 9391k} {GC 12209k -> 11320k} {GC 14717k -> 13483k} {GC 17529k -> 16296k} ge t_vis_list get_vis_enabled_list vis_disable_plugin vis_about vis_configure vis_playback_start vis_play back_stop enable_vis_plugin vis_enabled vis_stringify_enabled_list vis_enable_from_stringified_list ca lc_stereo_pcm calc_mono_pcm calc_freq calc_mono_freq calc_stereo_freq vis_send_data Analyzing compilation unit Performing interprocedural optimizations <visibility> <early_local_cleanups> <inline> <static-var> <pure-const> <type-escape-var>Assembling fu nctions: get_vis_list get_vis_enabled_list vis_playback_start vis_playback_stop vis_enable_from_stringified_li st vis_stringify_enabled_list vis_configure vis_about vis_enabled enable_vis_plugin vis_disable_plugin calc_mono_freq vis_send_data {GC 21223k -> 16452k} Program received signal SIGSEGV, Segmentation fault. verify_ssa_name (ssa_name=0xa5a5a5a5a5a5a5a5, is_virtual=0 '\0') at gcc/tree-ssa.c:109 109 if (TREE_CODE (ssa_name) != SSA_NAME) (gdb) where #0 verify_ssa_name (ssa_name=0xa5a5a5a5a5a5a5a5, is_virtual=0 '\0') at gcc/tree-ssa.c:109 #1 0x000000000079905b in verify_ssa (check_modified_stmt=1 '\001') at gcc/tree-ssa.c:716 #2 0x000000000060c795 in execute_function_todo (data=<value optimized out>) at gcc/passes.c:921 #3 0x000000000060c51b in execute_todo (flags=1053) at gcc/passes.c:945 #4 0x000000000060c9fa in execute_one_pass (pass=0xe37ae0) at gcc/passes.c:1090 #5 0x000000000060cb5c in execute_pass_list (pass=0xe37ae0) at gcc/passes.c:1120 #6 0x000000000060cb6e in execute_pass_list (pass=0xe370c0) at gcc/passes.c:1121 #7 0x000000000060cb6e in execute_pass_list (pass=0xe36ee0) at gcc/passes.c:1121 #8 0x000000000060cb6e in execute_pass_list (pass=0xe36340) at gcc/passes.c:1121 #9 0x00000000006da8ef in tree_rest_of_compilation (fndecl=0x2b0eb8ddd800) at gcc/tree-optimize.c:406 #10 0x000000000082cf70 in cgraph_expand_function (node=0x2b0eb9a8c800) at gcc/cgraphunit.c:1073 #11 0x000000000082eae5 in cgraph_optimize () at gcc/cgraphunit.c:1142 #12 0x0000000000413cbe in c_write_global_declarations () at gcc/c-decl.c:7917 #13 0x00000000006855c8 in toplev_main (argc=<value optimized out>, argv=<value optimized out>) at gcc/toplev.c:1064 #14 0x00002b0eb84478e4 in __libc_start_main () from /lib/libc.so.6 #15 0x0000000000403f99 in _start () (gdb) call debug_tree (ssa_name) Program received signal SIGSEGV, Segmentation fault. print_node (file=0x2b0eb8775840, prefix=0xa8c5c1 "", node=0xa5a5a5a5a5a5a5a5, indent=0) at gcc/print-tree.c:185 185 code = TREE_CODE (node); The program being debugged was signaled while in a function called from GDB. ...
(In reply to comment #0) > I'm getting the following segfault when I compile the beep-media-player > application with the options -ffast-math -funroll-all-loops -g -O3: Sorry, I forgot one option that's also needed: -ftree-vectorize
For the record, the command to see this is: /usr/lib/gcc-snapshot/bin/gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/X11R6/include -DPNG_NO_MMX_CODE -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/libpng12 -DPNG_NO_MMX_CODE -I/usr/include/libglade-2.0 -I/usr/include/gtk-2.0 -I/usr/include/libxml2 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -DDATA_DIR=\"/usr/share/bmp\" -DPLUGIN_DIR=\"/usr/lib/bmp\" -DPLUGINSUBS=\"Output\",\"Input\",\"Effect\",\"General\",\"Visualization\" -DLOCALEDIR=\"/usr/share/locale\" -I../intl -I.. -ffast-math -funroll-all-loops -g -O3 -ftree-vectorize -c visualization.c
Since this is obviously caused by GC (look at the backtrace and you have 0xa5a5a5a5....), use "--param ggc-min-expand=0 --param ggc-min-heapsize=0" as options to get a reduced testcase (it might take a little while but you should be able to reproduce it easier).
{GC 21223k -> 16452k} Program received signal SIGSEGV, Segmentation fault. verify_ssa_name (ssa_name=0xa5a5a5a5a5a5a5a5, is_virtual=0 '\0') at gcc/tree-ssa.c:109 109 if (TREE_CODE (ssa_name) != SSA_NAME) so it just got collected. I bet you'll get an ICE instead with checking enabled. So, can you nevertheless provide preprocessed source?
(In reply to comment #4) > Since this is obviously caused by GC (look at the backtrace and you have > 0xa5a5a5a5....), use "--param ggc-min-expand=0 --param ggc-min-heapsize=0" as > options to get a reduced testcase (it might take a little while but you should > be able to reproduce it easier). You're right, and now I remember you telling me before. I wonder why I didn't think of this. Thanks.
I wonder if this is the same or related to PR29975, see comment 100: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29975#c100
Created attachment 13660 [details] preprocessed source
Reducing, but this will take a while...
(sid)25696:tbm@em64t: ~] /usr/lib/gcc-snapshot/bin/gcc -ffast-math -O1 -ftree-vectorize --param ggc-min-expand=0 --param ggc-min-heapsize=0 beep-visualization.c beep-visualization.c: In function 'calc_freq': beep-visualization.c:3: internal compiler error: Segmentation fault Testcase: extern double sqrt (double __x); calc_freq (int *dest) { float tmp_out[257]; int i; for (i = 0; i < 256; i++) dest[i] = sqrt (tmp_out[i]); }
(gdb) p debug_generic_expr (stmt) D.1980_10 = 0.0 (gdb) p *stmt_ann (stmt)->operands.use_ops.use_ptr.use $14 = 0xa5a5a5a5 So somebody forgot to update the use cache.
I have a fix, there is a missing update_stmt :) at the very end of vectorizable_call after it does: /* The call in STMT might prevent it from being removed in dce. We however cannot remove it here, due to the way the ssa name it defines is mapped to the new definition. So just replace rhs of the statement with something harmless. */ type = TREE_TYPE (scalar_dest); GIMPLE_STMT_OPERAND (stmt, 1) = fold_convert (type, integer_zero_node);
Subject: Bug 32231 Author: pinskia Date: Thu Jun 7 02:12:31 2007 New Revision: 125521 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=125521 Log: 2007-06-06 Andrew Pinski <andrew_pinski@playstation.sony.com> PR tree-opt/32231 * tree-vect-transform.c (vectorizable_call): Call update_stmt after changing the right hand side of the assignment. 2007-06-06 Andrew Pinski <andrew_pinski@playstation.sony.com> PR tree-opt/32231 * gcc.target/i386/vectorize4.c: New test. Added: trunk/gcc/testsuite/gcc.target/i386/vectorize4.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-vect-transform.c
Fixed, thanks for the report.