This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/29534] New: ICE in "gcc -O -ftrapv" with decreasing array index
- From: "h dot b dot furuseth at usit dot uio dot no" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Oct 2006 11:16:24 -0000
- Subject: [Bug other/29534] New: ICE in "gcc -O -ftrapv" with decreasing array index
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
bash$ cat bug.c
int foo(int arr[]) {
int i = 2;
while (arr[--i]) ;
return i;
}
bash$ gcc -O -ftrapv -c bug.c
gcc: Internal error: Segmentation fault (program cc1)
bash$ g++ -O -ftrapv -c bug.c
g++: Internal error: Segmentation fault (program cc1plus)
Compilation succeeds if -O is removed. OTOH, it still crashes
with -O -fno-<all -O1 options listed in (gcc)Optimize Options>:
bash$ gcc -O -fno-defer-pop -fno-delayed-branch \
-fno-guess-branch-probability -fno-cprop-registers -fno-loop-optimize \
-fno-if-conversion -fno-if-conversion2 -fno-tree-ccp -fno-tree-dce \
-fno-tree-dominator-opts -fno-tree-dse -fno-tree-ter -fno-tree-lrs \
-fno-tree-sra -fno-tree-copyrename -fno-tree-fre -fno-tree-ch \
-fno-merge-constants -fno-omit-frame-pointer \
-ftrapv -c bug.c
gcc: Internal error: Segmentation fault (program cc1)
--
Summary: ICE in "gcc -O -ftrapv" with decreasing array index
Product: gcc
Version: 4.1.1
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: other
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: h dot b dot furuseth at usit dot uio dot no
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=29534