public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/38281] New: ice: Segmentation fault
@ 2008-11-27 0:26 regehr at cs dot utah dot edu
2008-11-27 0:39 ` [Bug rtl-optimization/38281] " pinskia at gcc dot gnu dot org
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: regehr at cs dot utah dot edu @ 2008-11-27 0:26 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1719 bytes --]
Seen using r142231 on Ubuntu Hardy on x86.
regehr@john-home:~/volatile/tmp69$ current-gcc -O small.c
small.c: In function func_41:
small.c:22: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
regehr@john-home:~/volatile/tmp69$ current-gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --program-prefix=current-
--enable-languages=c,c++ --prefix=/home/regehr : (reconfigured) ../configure
--program-prefix=current- --enable-languages=c,c++ --prefix=/home/regehr :
(reconfigured) ../configure --program-prefix=current- --enable-languages=c,c++
--prefix=/home/regehr
Thread model: posix
gcc version 4.4.0 20081126 (experimental) (GCC)
regehr@john-home:~/volatile/tmp69$ cat small.c
typedef unsigned short int uint16_t;
inline uint16_t safe_div_uint16_t_u_u (uint16_t ui1, uint16_t ui2)
{
if (ui2 == 0)
return ui1;
return ui1 / ui2;
}
uint16_t g_223;
uint16_t g_243;
int g_252;
int func_41 (uint16_t p_42)
{
int l_258 = 0;
int l_261 = 0x3D75D162L;
g_223 = safe_div_uint16_t_u_u (g_243 > l_261, func_110 (l_258, 1));
for (g_252 = 0; g_252; g_252 = 1)
{
}
}
--
Summary: ice: Segmentation fault
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
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=38281
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/38281] ice: Segmentation fault
2008-11-27 0:26 [Bug c/38281] New: ice: Segmentation fault regehr at cs dot utah dot edu
2008-11-27 0:39 ` [Bug rtl-optimization/38281] " pinskia at gcc dot gnu dot org
@ 2008-11-27 0:39 ` pinskia at gcc dot gnu dot org
2008-11-27 0:40 ` [Bug rtl-optimization/38281] [4.4 Regression] " pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-11-27 0:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2008-11-27 00:37 -------
#0 0x00487a55 in reg_referenced_p (x=0x42f137d0, body=0x0) at
/Users/apinski/src/local/gcc/gcc/rtlanal.c:737
#1 0x00af72a5 in distribute_notes (notes=0x42f134b0, from_insn=0x42f12a50,
i3=0x42f12a80, i2=0x42f12a50, elim_i2=0x42f13c80, elim_i1=0x0) at
/Users/apinski/src/local/gcc/gcc/combine.c:12578
#2 0x00add8c0 in try_combine (i3=0x42f12a80, i2=0x42f12a50, i1=0x42f12a20,
new_direct_jump_p=0xbffff6cc) at
/Users/apinski/src/local/gcc/gcc/combine.c:3590
#3 0x00ad70ba in combine_instructions (f=0x42f0ef00, nregs=69) at
/Users/apinski/src/local/gcc/gcc/combine.c:1156
#4 0x00af8020 in rest_of_handle_combine () at
/Users/apinski/src/local/gcc/gcc/combine.c:12989
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38281
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/38281] ice: Segmentation fault
2008-11-27 0:26 [Bug c/38281] New: ice: Segmentation fault regehr at cs dot utah dot edu
@ 2008-11-27 0:39 ` pinskia at gcc dot gnu dot org
2008-11-27 0:39 ` pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-11-27 0:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2008-11-27 00:38 -------
12578 else if (i2 != 0 && next_nonnote_insn (i2) == i3
12579 && reg_referenced_p (XEXP (note, 0), PATTERN
(i2)))
(gdb) p debug_rtx(i2)
(note 20 19 21 3 NOTE_INSN_DELETED)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38281
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/38281] [4.4 Regression] ice: Segmentation fault
2008-11-27 0:26 [Bug c/38281] New: ice: Segmentation fault regehr at cs dot utah dot edu
2008-11-27 0:39 ` [Bug rtl-optimization/38281] " pinskia at gcc dot gnu dot org
2008-11-27 0:39 ` pinskia at gcc dot gnu dot org
@ 2008-11-27 0:40 ` pinskia at gcc dot gnu dot org
2008-11-27 1:02 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-11-27 0:40 UTC (permalink / raw)
To: gcc-bugs
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|ice: Segmentation fault |[4.4 Regression] ice:
| |Segmentation fault
Target Milestone|--- |4.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38281
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/38281] [4.4 Regression] ice: Segmentation fault
2008-11-27 0:26 [Bug c/38281] New: ice: Segmentation fault regehr at cs dot utah dot edu
` (2 preceding siblings ...)
2008-11-27 0:40 ` [Bug rtl-optimization/38281] [4.4 Regression] " pinskia at gcc dot gnu dot org
@ 2008-11-27 1:02 ` pinskia at gcc dot gnu dot org
2008-11-27 10:03 ` jakub at gcc dot gnu dot org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-11-27 1:02 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2008-11-27 01:00 -------
This patch fixes the ICE:
Index: combine.c
===================================================================
--- combine.c (revision 142231)
+++ combine.c (working copy)
@@ -12575,7 +12575,7 @@ distribute_notes (rtx notes, rtx from_in
place = from_insn;
else if (reg_referenced_p (XEXP (note, 0), PATTERN (i3)))
place = i3;
- else if (i2 != 0 && next_nonnote_insn (i2) == i3
+ else if (i2 != 0 && INSN_P (i2) && next_nonnote_insn (i2) == i3
&& reg_referenced_p (XEXP (note, 0), PATTERN (i2)))
place = i2;
else if ((rtx_equal_p (XEXP (note, 0), elim_i2)
--- CUT ---
At -O1, g_243 > l_261 is not optimized to 0 at the tree level but the RTL level
which allows combine the ability to optimize the divide.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2008-11-27 01:00:40
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38281
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/38281] [4.4 Regression] ice: Segmentation fault
2008-11-27 0:26 [Bug c/38281] New: ice: Segmentation fault regehr at cs dot utah dot edu
` (3 preceding siblings ...)
2008-11-27 1:02 ` pinskia at gcc dot gnu dot org
@ 2008-11-27 10:03 ` jakub at gcc dot gnu dot org
2008-11-27 17:42 ` jsm28 at gcc dot gnu dot org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-11-27 10:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from jakub at gcc dot gnu dot org 2008-11-27 10:01 -------
Yeah, that looks reasonable (though I wonder if other places that use PATTERN
in
distribute_notes don't need similar treatment).
Simplified testcase below. Are you going to post it to gcc-patches?
inline unsigned short
foo (unsigned short x, unsigned short y)
{
if (y == 0)
return x;
return x / y;
}
unsigned short a, b, c;
extern int baz (int, int);
void
bar (void)
{
int d = 0x3D75D162;
a = foo (b > d, baz (0, 1));
for (c = 0; c; c = 1)
;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38281
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/38281] [4.4 Regression] ice: Segmentation fault
2008-11-27 0:26 [Bug c/38281] New: ice: Segmentation fault regehr at cs dot utah dot edu
` (4 preceding siblings ...)
2008-11-27 10:03 ` jakub at gcc dot gnu dot org
@ 2008-11-27 17:42 ` jsm28 at gcc dot gnu dot org
2008-11-29 2:46 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-11-27 17:42 UTC (permalink / raw)
To: gcc-bugs
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38281
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/38281] [4.4 Regression] ice: Segmentation fault
2008-11-27 0:26 [Bug c/38281] New: ice: Segmentation fault regehr at cs dot utah dot edu
` (5 preceding siblings ...)
2008-11-27 17:42 ` jsm28 at gcc dot gnu dot org
@ 2008-11-29 2:46 ` pinskia at gcc dot gnu dot org
2008-12-03 8:43 ` ebotcazou at gcc dot gnu dot org
2008-12-03 8:49 ` [Bug rtl-optimization/38281] [4.4 Regression] segmentation fault with optimization enabled ebotcazou at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-11-29 2:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pinskia at gcc dot gnu dot org 2008-11-29 02:45 -------
Mine, I was able to finally test this patch.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pinskia at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38281
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/38281] [4.4 Regression] ice: Segmentation fault
2008-11-27 0:26 [Bug c/38281] New: ice: Segmentation fault regehr at cs dot utah dot edu
` (6 preceding siblings ...)
2008-11-29 2:46 ` pinskia at gcc dot gnu dot org
@ 2008-12-03 8:43 ` ebotcazou at gcc dot gnu dot org
2008-12-03 8:49 ` [Bug rtl-optimization/38281] [4.4 Regression] segmentation fault with optimization enabled ebotcazou at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2008-12-03 8:43 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from ebotcazou at gcc dot gnu dot org 2008-12-03 08:42 -------
Subject: Bug 38281
Author: ebotcazou
Date: Wed Dec 3 08:40:50 2008
New Revision: 142388
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142388
Log:
PR rtl-optimization/38281
* combine.c (distribute_notes): When invoking SET_INSN_DELETED on i2,
set it to NULL_RTX afterwards.
* emit-rtl.c (set_insn_deleted): Fix formatting.
Added:
trunk/gcc/testsuite/gcc.c-torture/compile/20081203-1.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/combine.c
trunk/gcc/emit-rtl.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38281
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/38281] [4.4 Regression] segmentation fault with optimization enabled
2008-11-27 0:26 [Bug c/38281] New: ice: Segmentation fault regehr at cs dot utah dot edu
` (7 preceding siblings ...)
2008-12-03 8:43 ` ebotcazou at gcc dot gnu dot org
@ 2008-12-03 8:49 ` ebotcazou at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2008-12-03 8:49 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from ebotcazou at gcc dot gnu dot org 2008-12-03 08:47 -------
Thanks for reporting the problem.
--
ebotcazou at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Summary|[4.4 Regression] ice: |[4.4 Regression]
|Segmentation fault |segmentation fault with
| |optimization enabled
Version|unknown |4.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38281
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2008-12-03 8:49 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-27 0:26 [Bug c/38281] New: ice: Segmentation fault regehr at cs dot utah dot edu
2008-11-27 0:39 ` [Bug rtl-optimization/38281] " pinskia at gcc dot gnu dot org
2008-11-27 0:39 ` pinskia at gcc dot gnu dot org
2008-11-27 0:40 ` [Bug rtl-optimization/38281] [4.4 Regression] " pinskia at gcc dot gnu dot org
2008-11-27 1:02 ` pinskia at gcc dot gnu dot org
2008-11-27 10:03 ` jakub at gcc dot gnu dot org
2008-11-27 17:42 ` jsm28 at gcc dot gnu dot org
2008-11-29 2:46 ` pinskia at gcc dot gnu dot org
2008-12-03 8:43 ` ebotcazou at gcc dot gnu dot org
2008-12-03 8:49 ` [Bug rtl-optimization/38281] [4.4 Regression] segmentation fault with optimization enabled ebotcazou 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).