------- Comment #2 from gcc at pdoerfler dot com  2006-05-22 09:27 -------

I figured out the reduction. Here is a much smaller testcase:

=================================================================
extern int rows_;
extern int cols_;

template <typename U>
class secondOrderStatistics {
public:
  void covar2corrcoef(U** &cv) const {
    U* k=*cv;
    for (int row=0; row<rows_; row++) {
      const U drow=k[row];
      if (drow<0) {
        for (int column=0; column<cols_; column++, ++k) {
          (*k)=0;
        }
      } else {
        for (int column=0; column<cols_; column++, ++k) {
          const U dcol=k[column];
          if (dcol<0) {
            (*k)=0;
          } else {
            (*k)/=drow*dcol;
          }
        }
      }
    }
  }
};
template class secondOrderStatistics<float>;
=================================================================

/usr/local/vect/libexec/gcc/i686-pc-linux-gnu/4.2.0-autovect/cc1plus
-fpreprocessed reduced2.ii -quiet -march=pentium-m -ansi -O3 -version
-ftree-vectorize -o reduced2.s
GNU C++ version 4.2.0-autovect 20060518 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 4.2.0-autovect 20060518 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: ce12e1a5e2bda479d797d2bc5f9a8466
reduced2.ii: In member function ‘void
secondOrderStatistics<U>::covar2corrcoef(U**&) const [with U = float]’:
reduced2.ii:7: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

gdb says:
Program received signal SIGSEGV, Segmentation fault.
remove_all_phi_uses (var=0x4022da28) at tree-if-conv.c:180
180         if (TREE_CODE (usestmt) == PHI_NODE)
(gdb) print usestmt
$1 = 0x0
(gdb) bt
#0  remove_all_phi_uses (var=0x4022da28) at tree-if-conv.c:180
#1  0x0857fe48 in remove_all_phi_uses (var=0x4022f64c) at tree-if-conv.c:184
#2  0x0857fe48 in remove_all_phi_uses (var=0x4022da28) at tree-if-conv.c:184
#3  0x0857fe48 in remove_all_phi_uses (var=0x4022d9c0) at tree-if-conv.c:184
#4  0x0857fe48 in remove_all_phi_uses (var=0x4022db60) at tree-if-conv.c:184
#5  0x0857ff97 in remove_store (bsi=0xbfd512dc) at tree-if-conv.c:206
#6  0x08582763 in main_tree_if_conversion () at tree-if-conv.c:248
#7  0x084dad64 in execute_one_pass (pass=0x86f0900) at passes.c:874
#8  0x084daea7 in execute_pass_list (pass=0x86f0900) at passes.c:906
#9  0x084daeba in execute_pass_list (pass=0x86edca0) at passes.c:907
#10 0x084daeba in execute_pass_list (pass=0x86ed660) at passes.c:907
#11 0x081bacc6 in tree_rest_of_compilation (fndecl=0x40223c80) at
tree-optimize.c:419
#12 0x081294fd in expand_body (fn=0x40223c80) at semantics.c:3005
#13 0x08526f12 in cgraph_expand_function (node=0x402270d0) at cgraphunit.c:1055
#14 0x08529395 in cgraph_optimize () at cgraphunit.c:1121
#15 0x080d2bf5 in cp_finish_file () at decl2.c:3115
#16 0x0818d79f in c_common_parse_file (set_yydebug=0) at c-opts.c:1136
#17 0x084a90e0 in toplev_main (argc=11, argv=0xbfd515b4) at toplev.c:990
#18 0x0819ae6f in main (argc=Cannot access memory at address 0x0
) at main.c:35


-- 


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

Reply via email to