public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/29534]  New: ICE in "gcc -O -ftrapv" with decreasing array index
@ 2006-10-21 11:16 h dot b dot furuseth at usit dot uio dot no
  2006-10-21 12:13 ` [Bug other/29534] [4.1 Regression] " rguenth at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: h dot b dot furuseth at usit dot uio dot no @ 2006-10-21 11:16 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug other/29534] [4.1 Regression] ICE in "gcc -O -ftrapv" with decreasing array index
  2006-10-21 11:16 [Bug other/29534] New: ICE in "gcc -O -ftrapv" with decreasing array index h dot b dot furuseth at usit dot uio dot no
@ 2006-10-21 12:13 ` rguenth at gcc dot gnu dot org
  2007-01-21 21:47 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-10-21 12:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2006-10-21 12:12 -------
Confirmed.  Works with 4.2.

We endlessly fold

#5  0x08206aa1 in fold_unary (code=NEGATE_EXPR, type=0xb7c5c284,
    op0=0xb7cd3258) at /home/richard/src/gcc-4_1-branch/gcc/fold-const.c:6876
#6  0x08212e3e in fold_build1_stat (code=NEGATE_EXPR, type=0xb7c5c284,
    op0=0xb7cd3258) at /home/richard/src/gcc-4_1-branch/gcc/fold-const.c:10475
#7  0x081f8a05 in negate_expr (t=0xb7cd3258)
    at /home/richard/src/gcc-4_1-branch/gcc/fold-const.c:1167
#8  0x08206aa1 in fold_unary (code=NEGATE_EXPR, type=0xb7c5c284,
    op0=0xb7cd3258) at /home/richard/src/gcc-4_1-branch/gcc/fold-const.c:6876
#9  0x08212e3e in fold_build1_stat (code=NEGATE_EXPR, type=0xb7c5c284,
    op0=0xb7cd3258) at /home/richard/src/gcc-4_1-branch/gcc/fold-const.c:10475
#10 0x081f8a05 in negate_expr (t=0xb7cd3258)
...
#28 0x081f8a05 in negate_expr (t=0xb7cd3258)
    at /home/richard/src/gcc-4_1-branch/gcc/fold-const.c:1167
1167                  tree temp = fold_convert (ntype, TREE_OPERAND (t, 0));
(gdb) call debug_generic_expr (t)
-07fffffff

which has overflowed.

#29 0x08206aa1 in fold_unary (code=NEGATE_EXPR, type=0xb7c5c284,
    op0=0xb7cd3258) at /home/richard/src/gcc-4_1-branch/gcc/fold-const.c:6876
#30 0x08212e3e in fold_build1_stat (code=NEGATE_EXPR, type=0xb7c5c284,
    op0=0xb7cd3258) at /home/richard/src/gcc-4_1-branch/gcc/fold-const.c:10475
#31 0x081f8a05 in negate_expr (t=0xb7cd3258)
    at /home/richard/src/gcc-4_1-branch/gcc/fold-const.c:1167
#32 0x0820cb87 in fold_binary (code=CEIL_DIV_EXPR, type=0xb7c5c284,
    op0=0xb7cd3258, op1=0xb7c4da50)
    at /home/richard/src/gcc-4_1-branch/gcc/fold-const.c:8420
#33 0x08212e8e in fold_build2_stat (code=CEIL_DIV_EXPR, type=0xb7c5c284,
    op0=0xb7cd3258, op1=0xb7c4da50)
    at /home/richard/src/gcc-4_1-branch/gcc/fold-const.c:10521
#34 0x080fe243 in infer_loop_bounds_from_undefined (loop=0x86a5310)

#32 0x0820cb87 in fold_binary (code=CEIL_DIV_EXPR, type=0xb7c5c284,
    op0=0xb7cd3258, op1=0xb7c4da50)
    at /home/richard/src/gcc-4_1-branch/gcc/fold-const.c:8420
8420        case ROUND_DIV_EXPR:
(gdb) call debug_generic_expr (op0)
-07fffffff
(gdb) call debug_generic_expr (op1)
-1


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org, rakdver at gcc dot gnu
                   |                            |dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-valid-code
      Known to fail|                            |4.1.2
      Known to work|                            |4.0.3 4.2.0
   Last reconfirmed|0000-00-00 00:00:00         |2006-10-21 12:12:55
               date|                            |
            Summary|ICE in "gcc -O -ftrapv" with|[4.1 Regression] ICE in "gcc
                   |decreasing array index      |-O -ftrapv" with decreasing
                   |                            |array index


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug other/29534] [4.1 Regression] ICE in "gcc -O -ftrapv" with decreasing array index
  2006-10-21 11:16 [Bug other/29534] New: ICE in "gcc -O -ftrapv" with decreasing array index h dot b dot furuseth at usit dot uio dot no
  2006-10-21 12:13 ` [Bug other/29534] [4.1 Regression] " rguenth at gcc dot gnu dot org
@ 2007-01-21 21:47 ` pinskia at gcc dot gnu dot org
  2007-01-25  6:02 ` mmitchel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-01-21 21:47 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.1.2


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug other/29534] [4.1 Regression] ICE in "gcc -O -ftrapv" with decreasing array index
  2006-10-21 11:16 [Bug other/29534] New: ICE in "gcc -O -ftrapv" with decreasing array index h dot b dot furuseth at usit dot uio dot no
  2006-10-21 12:13 ` [Bug other/29534] [4.1 Regression] " rguenth at gcc dot gnu dot org
  2007-01-21 21:47 ` pinskia at gcc dot gnu dot org
@ 2007-01-25  6:02 ` mmitchel at gcc dot gnu dot org
  2007-02-14  9:19 ` mmitchel at gcc dot gnu dot org
  2008-07-04 15:53 ` jsm28 at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-01-25  6:02 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug other/29534] [4.1 Regression] ICE in "gcc -O -ftrapv" with decreasing array index
  2006-10-21 11:16 [Bug other/29534] New: ICE in "gcc -O -ftrapv" with decreasing array index h dot b dot furuseth at usit dot uio dot no
                   ` (2 preceding siblings ...)
  2007-01-25  6:02 ` mmitchel at gcc dot gnu dot org
@ 2007-02-14  9:19 ` mmitchel at gcc dot gnu dot org
  2008-07-04 15:53 ` jsm28 at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-02-14  9:19 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.1.2                       |4.1.3


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug other/29534] [4.1 Regression] ICE in "gcc -O -ftrapv" with decreasing array index
  2006-10-21 11:16 [Bug other/29534] New: ICE in "gcc -O -ftrapv" with decreasing array index h dot b dot furuseth at usit dot uio dot no
                   ` (3 preceding siblings ...)
  2007-02-14  9:19 ` mmitchel at gcc dot gnu dot org
@ 2008-07-04 15:53 ` jsm28 at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 15:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jsm28 at gcc dot gnu dot org  2008-07-04 15:53 -------
Closing 4.1 branch.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to fail|4.1.2                       |4.1.2 4.1.3
         Resolution|                            |FIXED
   Target Milestone|4.1.3                       |4.2.0


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-07-04 15:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-21 11:16 [Bug other/29534] New: ICE in "gcc -O -ftrapv" with decreasing array index h dot b dot furuseth at usit dot uio dot no
2006-10-21 12:13 ` [Bug other/29534] [4.1 Regression] " rguenth at gcc dot gnu dot org
2007-01-21 21:47 ` pinskia at gcc dot gnu dot org
2007-01-25  6:02 ` mmitchel at gcc dot gnu dot org
2007-02-14  9:19 ` mmitchel at gcc dot gnu dot org
2008-07-04 15:53 ` jsm28 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).