System: Ubuntu 7.10 gcc version: 4.2.0 Problem: Using openmp extension erro interno de compilação: in create_tmp_var, at gimplify.c:487
Created attachment 15142 [details] source
Created attachment 15143 [details] header
Created attachment 15144 [details] .i
G++ gives raycaster.cpp: In member function ‘void Raycaster::cast() const’: raycaster.cpp:43: erro interno de compilação: in create_tmp_var, at gimplify.c:487 Por favor, envie um relato completo de erro, com o código pré-processado se possível. Veja <URL:http://gcc.gnu.org/bugs.html> para instruções. For Debian GNU/Linux specific bug reporting instructions, see <URL:file:///usr/share/doc/gcc-4.2/README.Bugs>. make: ** [raycaster.o] Erro 1 trying to compile raycaster.cpp with g++-4.2 -c -O3 -pipe -mmmx -m3dnow -msse2 -msse -fopenmp -save-temps raycaster.cpp -o raycaster.o on ubuntu 7.10
Simplified testcase: struct S { S (); ~S (); int s; }; void bar (S); void foo () { S s; #pragma omp parallel shared (s) bar (s); } Works if s is firstprivate or private, or if it doesn't have user defined destructor.
The problem is the regimplifying done by lower_omp_1. We have D.NNNN = s; where both of the vars have RECORD_TYPE with TREE_ADDRESSABLE types. lower_omp_1 sees on the right hand side VAR_DECL with DECL_VALUE_EXPR (wi->is_lhs = false, wi->val_only = true), which is replaced with *.omp_data_i->s which doesn't satisfy is_gimple_val predicate lower_regimplify uses and of course the compiler isn't allowed to create temporaries of TREE_ADDRESSABLE types on its own. In this case I believe we need to force the .omp_data_i->s address into a temporary first and then *temp should hopefully satisfy the predicate. Diego, any ideas?
*** Bug 35247 has been marked as a duplicate of this bug. ***
Created attachment 15305 [details] gcc44-pr35185.patch WIP patch I'm playing with. It just looks for statements that reference variables with DECL_HAS_VALUE_EXPR_P and regimplifies them as whole, rather than only regimplifying parts of them. I still get 4 libgomp regressions: FAIL: libgomp.c/nestedfn-4.c execution test FAIL: libgomp.c/pr33880.c execution test FAIL: libgomp.c/pr35130.c execution test FAIL: libgomp.fortran/pr35130.f90 -O execution test and most likely further work will be needed for -ftree-parallelize-loops where lower_omp is called on SSA.
Subject: Bug 35185 Author: jakub Date: Thu Mar 13 09:26:25 2008 New Revision: 133162 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133162 Log: PR middle-end/35185 * omp-low.c (lower_regimplify, init_tmp_var, save_tmp_var): Removed. (lower_omp_2): New function. (lower_omp_1, lower_omp): Rewritten. * testsuite/libgomp.c++/pr35185.C: New test. Added: trunk/libgomp/testsuite/libgomp.c++/pr35185.C Modified: trunk/gcc/ChangeLog trunk/gcc/omp-low.c trunk/libgomp/ChangeLog
Subject: Bug 35185 Author: jakub Date: Thu Mar 13 09:57:34 2008 New Revision: 133165 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133165 Log: PR middle-end/35185 * omp-low.c (lower_regimplify, init_tmp_var, save_tmp_var): Removed. (lower_omp_2): New function. (lower_omp_1, lower_omp): Rewritten. * testsuite/libgomp.c++/pr35185.C: New test. Added: branches/gcc-4_3-branch/libgomp/testsuite/libgomp.c++/pr35185.C - copied unchanged from r133162, trunk/libgomp/testsuite/libgomp.c++/pr35185.C Modified: branches/gcc-4_3-branch/gcc/ChangeLog branches/gcc-4_3-branch/gcc/omp-low.c branches/gcc-4_3-branch/libgomp/ChangeLog
Fixed for 4.3.1 and later.