Summary: | ICE on ia64 with vector declaration inside #pragma omp parallel | ||
---|---|---|---|
Product: | gcc | Reporter: | Sebastian Steiger <steigers> |
Component: | target | Assignee: | Jakub Jelinek <jakub> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gcc-bugs, pinskia |
Priority: | P3 | Keywords: | openmp |
Version: | 4.3.0 | ||
Target Milestone: | 4.4.0 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2008-04-04 14:38:51 | |
Attachments: |
Preprocessed file (.ii)
tree-eh.c optimize_double_finally patch |
Description
Sebastian Steiger
2008-02-25 10:35:06 UTC
Created attachment 15221 [details]
Preprocessed file (.ii)
What is the ICE? (In reply to comment #2) > What is the ICE? > Segmentation fault. GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 Compiler executable checksum: 84cf8bc685ded1e544606791a260313c ice.h: In member function 'void A::foo()': ice.h:11: internal compiler error: Segmentation fault Subject: Re: New: ICE on ia64 with vector declaration
inside #pragma omp parallel
steigers at phys dot ethz dot ch wrote:
> g++ -Wall -fopenmp -save-temps -o ice.o -c ice.h
I can reproduce this.
It dies in the eh pass. We have a TRY_CATCH_EXPR with an empty catch
clause. This fails in lower_eh_constructs_1 case TRY_CATCH_EXPR, as
i->ptr is null, and hence tsi_stmt segfaults.
It seems wrong to have an empty catch clause here. This was created
during the ehopt pass by optimize_double_finally. We have
try { A() } finally { try { } catch { ~A() } }
try { ... } finally { ~A() }
which is converted into
try { A() } catch { }
try { ~B() ... } finally { ~A() }
thus giving us the problematic empty catch clause.
The testcase doesn't fail on x86 as we end up with slightly different
gimple. In the 004t.gimple dump file, for x86 we have
struct vector x;
__comp_ctor (&D.7263);
try
{
D.7261 = 0.0;
and for IA-64 we have
struct vector x;
D.7300 = 0.0;
try
{
__comp_ctor (&D.7302);
The different placement of the ctor means the dtor ends up in different
places, and hence the bug triggers on IA-64 but not x86. I don't know
why we are getting the different gimplification here. This seems odd,
but I haven't tried looking into this yet.
Jim
Created attachment 15401 [details]
tree-eh.c optimize_double_finally patch
This patch works for the testcase, but is otherwise untested. My knowledge in this area is limited, so this needs to be reviewed by someone with more tree-ssa and tree-eh knowledge than me.
optimize_double_finally relies here on the useless pass doing its job. But on the trunk/4.3 the useless pass doesn't dive into OpenMP constructs. This is fixed on the gomp-3_0-branch, see the remove_useless_stmts_1 hunk in http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00261.html At that point I didn't know of any testcase that would be affected on the trunk/4.3 too, so I've committed that just to gomp-3_0-branch, but will backport it now to the trunk/4.3. Subject: Bug 35364 Author: jakub Date: Fri Apr 4 17:48:45 2008 New Revision: 133905 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133905 Log: PR target/35364 * tree-cfg.c (remove_useless_stmts_1): Handle OMP_* containers. * g++.dg/gomp/pr35364.C: New test. Added: trunk/gcc/testsuite/g++.dg/gomp/pr35364.C Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-cfg.c Subject: Bug 35364 Author: jakub Date: Fri Apr 4 18:00:25 2008 New Revision: 133906 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133906 Log: PR target/35364 * tree-cfg.c (remove_useless_stmts_1): Handle OMP_* containers. * g++.dg/gomp/pr35364.C: New test. Added: branches/gcc-4_3-branch/gcc/testsuite/g++.dg/gomp/pr35364.C Modified: branches/gcc-4_3-branch/gcc/ChangeLog branches/gcc-4_3-branch/gcc/testsuite/ChangeLog branches/gcc-4_3-branch/gcc/tree-cfg.c Fixed. |