public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14553] New: ICE on valid code
@ 2004-03-12 13:45 schnetter at aei dot mpg dot de
2004-03-12 13:48 ` [Bug c++/14553] " schnetter at aei dot mpg dot de
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: schnetter at aei dot mpg dot de @ 2004-03-12 13:45 UTC (permalink / raw)
To: gcc-bugs
I compile the attached code with a recent version of g++, and I receive a
segmentation fault.
$ /home/eschnett/gcc-3.5-tree-ssa/bin/g++ -v
Reading specs
from /home/eschnett/gcc-3.5-tree-ssa/lib/gcc/i686-pc-linux-gnu/3.5-tree-ssa/specs
Configured with: ../gcc/configure --prefix=/home/eschnett/gcc-3.5-tree-ssa
--enable-languages=c,c++,f95
Thread model: posix
gcc version 3.5-tree-ssa 20040312 (merged 20040307)
/home/eschnett/gcc-3.5-tree-ssa/bin/g++ -DCARPET_INT -DCARPET_REAL
-DCARPET_COMPLEX -march=pentium3 -malign-double -m128bit-long-double -g3 -O3
-funroll-loops -Wall -Wpointer-arith -Wcast-qual -Wcast-align -S data.ii
-I/usr/include -I/usr/lib/mpich/include -I/usr/lib/petscdir/2.1.6/include
-I/usr/lib/petscdir/2.1.6/bmake/linux
-I/home/eschnett/Calpha/Cactus/arrangements/Carpet/CarpetLib/src
-I/home/eschnett/Calpha/Cactus/arrangements/Carpet/CarpetLib/src/include
-I/home/eschnett/Calpha/Cactus/configs/einstein-gfortran/config-data
-I/home/eschnett/Calpha/Cactus/configs/einstein-gfortran/bindings/include
-I/home/eschnett/Calpha/Cactus/src/include
-I/home/eschnett/Calpha/Cactus/arrangements
-I/home/eschnett/Calpha/Cactus/arrangements/Carpet/CarpetLib/src
-I/home/eschnett/Calpha/Cactus/arrangements/Carpet/CarpetLib/src/include
-DTHORN_IS_CarpetLib -DCCODE
/home/eschnett/Calpha/Cactus/configs/einstein-gfortran/build/CarpetLib/data.cc:
In member function `void data<T,
D>::interpolate_from_innerloop(__gnu_norm::vector<const gdata<D>*,
std::allocator<const gdata<D>*> >, __gnu_norm::vector<double,
std::allocator<double> >, const bbox<int, D>&, double, int, int) [with T =
double, int D = 3]':
/home/eschnett/Calpha/Cactus/configs/einstein-gfortran/build/CarpetLib/data.cc:789:
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.
--
Summary: ICE on valid code
Product: gcc
Version: tree-ssa
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: schnetter at aei dot mpg dot de
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14553
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/14553] ICE on valid code
2004-03-12 13:45 [Bug c++/14553] New: ICE on valid code schnetter at aei dot mpg dot de
@ 2004-03-12 13:48 ` schnetter at aei dot mpg dot de
2004-03-12 14:10 ` reichelt at gcc dot gnu dot org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: schnetter at aei dot mpg dot de @ 2004-03-12 13:48 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From schnetter at aei dot mpg dot de 2004-03-12 13:48 -------
Created an attachment (id=5907)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5907&action=view)
Failing preprocessed source code, gzipped
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14553
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/14553] ICE on valid code
2004-03-12 13:45 [Bug c++/14553] New: ICE on valid code schnetter at aei dot mpg dot de
2004-03-12 13:48 ` [Bug c++/14553] " schnetter at aei dot mpg dot de
@ 2004-03-12 14:10 ` reichelt at gcc dot gnu dot org
2004-03-12 14:12 ` reichelt at gcc dot gnu dot org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-03-12 14:10 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-03-12 14:10 -------
Here's something smaller to trigger the segfault - just compile with "-O3":
===================================================
#include<vector>
std::vector<int> v(1);
===================================================
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14553
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/14553] ICE on valid code
2004-03-12 13:45 [Bug c++/14553] New: ICE on valid code schnetter at aei dot mpg dot de
2004-03-12 13:48 ` [Bug c++/14553] " schnetter at aei dot mpg dot de
2004-03-12 14:10 ` reichelt at gcc dot gnu dot org
@ 2004-03-12 14:12 ` reichelt at gcc dot gnu dot org
2004-03-12 15:02 ` [Bug optimization/14553] segfault involving pointers reichelt at gcc dot gnu dot org
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-03-12 14:12 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |reichelt at gcc dot gnu dot
| |org
Keywords| |ice-on-valid-code
Known to work| |3.4.0 3.5.0
Target Milestone|--- |tree-ssa
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14553
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug optimization/14553] segfault involving pointers
2004-03-12 13:45 [Bug c++/14553] New: ICE on valid code schnetter at aei dot mpg dot de
` (2 preceding siblings ...)
2004-03-12 14:12 ` reichelt at gcc dot gnu dot org
@ 2004-03-12 15:02 ` reichelt at gcc dot gnu dot org
2004-03-12 15:30 ` dnovillo at gcc dot gnu dot org
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-03-12 15:02 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-03-12 15:02 -------
Redux (crashes gcc and g++, just compile with -O3):
===============================================
void foo(int* p)
{
int i;
for (i=1; i>0; --i, ++p)
*p=0;
}
void bar(int* p) { foo(p); }
===============================================
Might be related to PR 14433, where the bug magically disappeared today.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Component|c++ |optimization
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-03-12 15:02:52
date| |
Summary|ICE on valid code |segfault involving pointers
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14553
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug optimization/14553] segfault involving pointers
2004-03-12 13:45 [Bug c++/14553] New: ICE on valid code schnetter at aei dot mpg dot de
` (3 preceding siblings ...)
2004-03-12 15:02 ` [Bug optimization/14553] segfault involving pointers reichelt at gcc dot gnu dot org
@ 2004-03-12 15:30 ` dnovillo at gcc dot gnu dot org
2004-03-12 15:39 ` dnovillo at gcc dot gnu dot org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2004-03-12 15:30 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dnovillo at gcc dot gnu dot org 2004-03-12 15:29 -------
Works for me on tree-ssa
$ ./cc1 --version
GNU C version 3.5-tree-ssa 20040311 (merged 20040307) (i686-pc-linux-gnu)
compiled by GNU C version 3.5-tree-ssa 20040311 (merged 20040307).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14553
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug optimization/14553] segfault involving pointers
2004-03-12 13:45 [Bug c++/14553] New: ICE on valid code schnetter at aei dot mpg dot de
` (4 preceding siblings ...)
2004-03-12 15:30 ` dnovillo at gcc dot gnu dot org
@ 2004-03-12 15:39 ` dnovillo at gcc dot gnu dot org
2004-03-13 4:31 ` [Bug optimization/14553] [tree-ssa] " dnovillo at redhat dot com
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2004-03-12 15:39 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dnovillo at gcc dot gnu dot org 2004-03-12 15:39 -------
I probably broke this with my Mar11 patch.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |dnovillo at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14553
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug optimization/14553] [tree-ssa] segfault involving pointers
2004-03-12 13:45 [Bug c++/14553] New: ICE on valid code schnetter at aei dot mpg dot de
` (5 preceding siblings ...)
2004-03-12 15:39 ` dnovillo at gcc dot gnu dot org
@ 2004-03-13 4:31 ` dnovillo at redhat dot com
2004-03-13 15:01 ` cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: dnovillo at redhat dot com @ 2004-03-13 4:31 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dnovillo at redhat dot com 2004-03-13 04:31 -------
Subject: Re: [tree-ssa] segfault involving pointers
On Fri, 2004-03-12 at 10:02, reichelt at gcc dot gnu dot org wrote:
> ------- Additional Comments From reichelt at gcc dot gnu dot org 2004-03-12 15:02 -------
> Redux (crashes gcc and g++, just compile with -O3):
>
> ===============================================
> void foo(int* p)
> {
> int i;
> for (i=1; i>0; --i, ++p)
> *p=0;
> }
>
> void bar(int* p) { foo(p); }
> ===============================================
>
> Might be related to PR 14433, where the bug magically disappeared today.
>
It wasn't. This was another case of a pass doing value propagation not
using propagate_value. Fixed with patch below. Will commit after tests
are finished.
Diego.
PR optimization/14553
* tree-ssa.c (replace_immediate_uses): Call propagate_value to
update operands.
Index: tree-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa.c,v
retrieving revision 1.1.4.211
diff -d -c -p -d -u -p -r1.1.4.211 tree-ssa.c
--- tree-ssa.c 12 Mar 2004 04:19:06 -0000 1.1.4.211
+++ tree-ssa.c 13 Mar 2004 03:44:52 -0000
@@ -3850,19 +3850,19 @@ replace_immediate_uses (tree var, tree r
uses = STMT_USE_OPS (stmt);
for (j = 0; j < (int) NUM_USES (uses); j++)
if (USE_OP (uses, j) == var)
- *USE_OP_PTR (uses, j) = repl;
+ propagate_value (USE_OP_PTR (uses, j), repl);
}
else
{
vuses = STMT_VUSE_OPS (stmt);
for (j = 0; j < (int) NUM_VUSES (vuses); j++)
if (VUSE_OP (vuses, j) == var)
- *VUSE_OP_PTR (vuses, j) = repl;
+ propagate_value (VUSE_OP_PTR (vuses, j), repl);
vdefs = STMT_VDEF_OPS (stmt);
for (j = 0; j < (int) NUM_VDEFS (vdefs); j++)
if (VDEF_OP (vdefs, j) == var)
- *VDEF_OP_PTR (vdefs, j) = repl;
+ propagate_value (VDEF_OP_PTR (vdefs, j), repl);
}
modify_stmt (stmt);
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14553
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug optimization/14553] [tree-ssa] segfault involving pointers
2004-03-12 13:45 [Bug c++/14553] New: ICE on valid code schnetter at aei dot mpg dot de
` (6 preceding siblings ...)
2004-03-13 4:31 ` [Bug optimization/14553] [tree-ssa] " dnovillo at redhat dot com
@ 2004-03-13 15:01 ` cvs-commit at gcc dot gnu dot org
2004-03-13 15:02 ` dnovillo at gcc dot gnu dot org
2004-03-13 15:22 ` cvs-commit at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-03-13 15:01 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-03-13 15:00 -------
Subject: Bug 14553
CVSROOT: /cvs/gcc
Module name: gcc
Branch: tree-ssa-20020619-branch
Changes by: dnovillo@gcc.gnu.org 2004-03-13 15:00:55
Modified files:
gcc : ChangeLog.tree-ssa tree-ssa.c
Log message:
PR optimization/14553
* tree-ssa.c (replace_immediate_uses): Call propagate_value to
update operands.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.tree-ssa.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.1271&r2=1.1.2.1272
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa.c.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.4.211&r2=1.1.4.212
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14553
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug optimization/14553] [tree-ssa] segfault involving pointers
2004-03-12 13:45 [Bug c++/14553] New: ICE on valid code schnetter at aei dot mpg dot de
` (7 preceding siblings ...)
2004-03-13 15:01 ` cvs-commit at gcc dot gnu dot org
@ 2004-03-13 15:02 ` dnovillo at gcc dot gnu dot org
2004-03-13 15:22 ` cvs-commit at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2004-03-13 15:02 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dnovillo at gcc dot gnu dot org 2004-03-13 15:02 -------
Fixed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14553
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug optimization/14553] [tree-ssa] segfault involving pointers
2004-03-12 13:45 [Bug c++/14553] New: ICE on valid code schnetter at aei dot mpg dot de
` (8 preceding siblings ...)
2004-03-13 15:02 ` dnovillo at gcc dot gnu dot org
@ 2004-03-13 15:22 ` cvs-commit at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-03-13 15:22 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-03-13 15:22 -------
Subject: Bug 14553
CVSROOT: /cvs/gcc
Module name: gcc
Branch: tree-ssa-20020619-branch
Changes by: dnovillo@gcc.gnu.org 2004-03-13 15:21:58
Modified files:
gcc/testsuite : ChangeLog.tree-ssa
Added files:
gcc/testsuite/gcc.dg/tree-ssa: 20040313-1.c
Log message:
PR optimization/14553
* gcc.dg/tree-ssa/20040313-1.c: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.tree-ssa.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.189&r2=1.1.2.190
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/tree-ssa/20040313-1.c.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=NONE&r2=1.1.2.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14553
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2004-03-13 15:22 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-12 13:45 [Bug c++/14553] New: ICE on valid code schnetter at aei dot mpg dot de
2004-03-12 13:48 ` [Bug c++/14553] " schnetter at aei dot mpg dot de
2004-03-12 14:10 ` reichelt at gcc dot gnu dot org
2004-03-12 14:12 ` reichelt at gcc dot gnu dot org
2004-03-12 15:02 ` [Bug optimization/14553] segfault involving pointers reichelt at gcc dot gnu dot org
2004-03-12 15:30 ` dnovillo at gcc dot gnu dot org
2004-03-12 15:39 ` dnovillo at gcc dot gnu dot org
2004-03-13 4:31 ` [Bug optimization/14553] [tree-ssa] " dnovillo at redhat dot com
2004-03-13 15:01 ` cvs-commit at gcc dot gnu dot org
2004-03-13 15:02 ` dnovillo at gcc dot gnu dot org
2004-03-13 15:22 ` cvs-commit at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).