public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/14692] New: [tree-ssa] ICE in canon_condition
@ 2004-03-23 13:25 falk at debian dot org
2004-03-23 14:34 ` [Bug optimization/14692] [3.5 Regression] " pinskia at gcc dot gnu dot org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: falk at debian dot org @ 2004-03-23 13:25 UTC (permalink / raw)
To: gcc-bugs
GNU C version 3.5-tree-ssa 20040318 (merged 20040307)
% cat test.c
void assert_failed (void);
void eidecpos_1 (unsigned char *pos, long n)
{
int i;
for (i = 0; i < n; i++)
{
const unsigned char *dc_ptr1 = pos;
pos--;
if (dc_ptr1 - pos == 1)
assert_failed ();
}
}
% gcc -c -O3 test.c
test.c: In function `eidecpos_1':
test.c:12: internal compiler error: in canon_condition, at loop-iv.c:1413
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Does not occur at -O2.
--
Summary: [tree-ssa] ICE in canon_condition
Product: gcc
Version: tree-ssa
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P2
Component: optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: falk at debian dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: alphaev68-unknown-linux-gnu
GCC host triplet: alphaev68-unknown-linux-gnu
GCC target triplet: alphaev68-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14692
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug optimization/14692] [3.5 Regression] ICE in canon_condition
2004-03-23 13:25 [Bug optimization/14692] New: [tree-ssa] ICE in canon_condition falk at debian dot org
@ 2004-03-23 14:34 ` pinskia at gcc dot gnu dot org
2004-05-09 15:32 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-23 14:34 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-03-23 14:34 -------
Confirmed.
Here is the RTL which it is ICE on:
(ne:SI (const_int 1 [0x1])
(const_int 1 [0x1]))
Backtrace:
#0 fancy_abort (file=0x7598bc "/Users/pinskia/src/gcc-tree-ssa/gcc/gcc/loop-iv.c", line=1413,
function=0x7599b8 "canon_condition") at /Users/pinskia/src/gcc-tree-ssa/gcc/gcc/diagnostic.c:583
#1 0x006a742c in canon_condition (cond=0x414dd2a0) at /Users/pinskia/src/gcc-tree-ssa/gcc/gcc/
loop-iv.c:1413
#2 0x0062b918 in may_unswitch_on (bb=0x414d9364, loop=0x41304210, cinsn=0xbffff580) at /
Users/pinskia/src/gcc-tree-ssa/gcc/gcc/loop-unswitch.c:236
#3 0x0062bc18 in unswitch_single_loop (loops=0x413029a0, loop=0x41304210,
cond_checked=0x0, num=0) at /Users/pinskia/src/gcc-tree-ssa/gcc/gcc/loop-unswitch.c:325
#4 0x0062b51c in unswitch_loops (loops=0x413029a0) at /Users/pinskia/src/gcc-tree-ssa/gcc/gcc/
loop-unswitch.c:160
#5 0x003713d8 in rest_of_handle_loop2 (decl=0x414d22e8, insns=0x414549e0) at /Users/pinskia/
src/gcc-tree-ssa/gcc/gcc/passes.c:1312
#6 0x00371e38 in rest_of_compilation (decl=0x414d22e8) at /Users/pinskia/src/gcc-tree-ssa/gcc/
gcc/passes.c:1601
#7 0x00374418 in tree_rest_of_compilation (fndecl=0x414d22e8, nested_p=false) at /Users/pinskia/
src/gcc-tree-ssa/gcc/gcc/tree-optimize.c:596
#8 0x0002fab0 in c_expand_body_1 (fndecl=0x414d22e8, nested_p=0) at /Users/pinskia/src/gcc-
tree-ssa/gcc/gcc/c-decl.c:6195
#9 0x0002fe4c in c_expand_body (fndecl=0x414d22e8) at /Users/pinskia/src/gcc-tree-ssa/gcc/gcc/
c-decl.c:6227
#10 0x00365a10 in cgraph_expand_function (node=0x414d2aa8) at /Users/pinskia/src/gcc-tree-ssa/
gcc/gcc/cgraphunit.c:789
#11 0x003688dc in cgraph_expand_all_functions () at /Users/pinskia/src/gcc-tree-ssa/gcc/gcc/
cgraphunit.c:1671
#12 0x00368d34 in cgraph_optimize () at /Users/pinskia/src/gcc-tree-ssa/gcc/gcc/cgraphunit.c:1761
#13 0x000a4908 in c_objc_common_finish_file () at /Users/pinskia/src/gcc-tree-ssa/gcc/gcc/c-objc-
common.c:243
#14 0x0000f054 in finish_file () at /Users/pinskia/src/gcc-tree-ssa/gcc/gcc/c-lang.c:199
#15 0x000960cc in c_common_parse_file (set_yydebug=0) at /Users/pinskia/src/gcc-tree-ssa/gcc/
gcc/c-opts.c:1244
#16 0x0011c700 in compile_file () at /Users/pinskia/src/gcc-tree-ssa/gcc/gcc/toplev.c:1627
#17 0x0011f0e8 in do_compile () at /Users/pinskia/src/gcc-tree-ssa/gcc/gcc/toplev.c:2623
#18 0x0011f180 in toplev_main (argc=4, argv=0xbffffc78) at /Users/pinskia/src/gcc-tree-ssa/gcc/
gcc/toplev.c:2655
#19 0x000c4c24 in main (argc=4, argv=0xbffffc78) at /Users/pinskia/src/gcc-tree-ssa/gcc/gcc/
main.c:35
And miss optimization on the tree-level:
dc_ptr1 = (const unsigned char *)pos;
pos = pos - 1B;
if ((int)dc_ptr1 - (int)pos == 1) goto <L1>; else goto <L2>;
since pos - 1 == dc_ptr1 then "(int)dc_ptr1 - (int)pos == 1" will always be true.
And here is a testcase which fails on the mainline (derived from the last tree dump):
void assert_failed (void);
void eidecpos_1 (unsigned char *pos, long n)
{
const unsigned char * dc_ptr1;
int i;
if (n > 0) goto L11;else goto L4;
L11:
i = 0;
L0:
dc_ptr1 = (const unsigned char *)pos;
pos = pos - 1;
if ((int)dc_ptr1 - (int)pos == 1) goto L1;else goto L2;
L1:
assert_failed();
L2:
i = i +1;
if (i < n) goto L0;else goto L4;
L4:
return;
}
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |critical
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |RTL
Known to fail| |3.5.0
Known to work| |3.3.3
Last reconfirmed|0000-00-00 00:00:00 |2004-03-23 14:34:15
date| |
Summary|[tree-ssa] ICE in |[3.5 Regression] ICE in
|canon_condition |canon_condition
Target Milestone|--- |3.5.0
Version|tree-ssa |3.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14692
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug optimization/14692] [3.5 Regression] ICE in canon_condition
2004-03-23 13:25 [Bug optimization/14692] New: [tree-ssa] ICE in canon_condition falk at debian dot org
2004-03-23 14:34 ` [Bug optimization/14692] [3.5 Regression] " pinskia at gcc dot gnu dot org
@ 2004-05-09 15:32 ` pinskia at gcc dot gnu dot org
2004-05-09 15:33 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-09 15:32 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-05-09 15:32 -------
*** Bug 15344 has been marked as a duplicate of this bug. ***
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |steven at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14692
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug optimization/14692] [3.5 Regression] ICE in canon_condition
2004-03-23 13:25 [Bug optimization/14692] New: [tree-ssa] ICE in canon_condition falk at debian dot org
2004-03-23 14:34 ` [Bug optimization/14692] [3.5 Regression] " pinskia at gcc dot gnu dot org
2004-05-09 15:32 ` pinskia at gcc dot gnu dot org
@ 2004-05-09 15:33 ` pinskia at gcc dot gnu dot org
2004-05-11 16:37 ` rakdver at gcc dot gnu dot org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-09 15:33 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-05-09 15:33 -------
Assigning to Zdenek based on what steven said to do.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |rakdver at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14692
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug optimization/14692] [3.5 Regression] ICE in canon_condition
2004-03-23 13:25 [Bug optimization/14692] New: [tree-ssa] ICE in canon_condition falk at debian dot org
` (2 preceding siblings ...)
2004-05-09 15:33 ` pinskia at gcc dot gnu dot org
@ 2004-05-11 16:37 ` rakdver at gcc dot gnu dot org
2004-05-20 18:43 ` [Bug rtl-optimization/14692] " cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: rakdver at gcc dot gnu dot org @ 2004-05-11 16:37 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rakdver at gcc dot gnu dot org 2004-05-10 18:02 -------
Patch:
http://gcc.gnu.org/ml/gcc-patches/2004-05/msg00524.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14692
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug rtl-optimization/14692] [3.5 Regression] ICE in canon_condition
2004-03-23 13:25 [Bug optimization/14692] New: [tree-ssa] ICE in canon_condition falk at debian dot org
` (3 preceding siblings ...)
2004-05-11 16:37 ` rakdver at gcc dot gnu dot org
@ 2004-05-20 18:43 ` cvs-commit at gcc dot gnu dot org
2004-05-20 19:27 ` pinskia at gcc dot gnu dot org
2004-08-08 23:17 ` cvs-commit at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-05-20 18:43 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-05-19 17:53 -------
Subject: Bug 14692
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: rakdver@gcc.gnu.org 2004-05-19 17:53:45
Modified files:
gcc : ChangeLog function.c function.h loop-iv.c
loop-unswitch.c rtl.h simplify-rtx.c
stor-layout.c tree.h
Log message:
PR c++/15463
* loop-iv.c (iv_number_of_iterations): Use trunc_int_for_mode on
result of inverse.
PR rtl-optimization/15274
* loop-iv.c (determine_max_iter, shorten_into_mode,
iv_number_of_iterations): Handle constants correctly.
* rtl.h (get_mode_bounds): Declaration changed.
* stor-layout.c (get_mode_bounds): Return a constant suitable for
the target mode.
PR rtl-optimization/14692
* loop-unswitch.c (may_unswitch_on): Try folding the result.
(unswitch_single_loop): Work correctly when may_unswitch_on
returns a folded constant.
* loop-iv.c (implies_p): Handle A < B ==> A + 1 <= B.
* simplify-rtx.c (simplify_const_relational_operation): Optimize
comparisons with mode bounds.
* function.c (struct temp_slot): Add new field prev.
(free_after_compilation, init_temp_slots): Free new fields.
(cut_slot_from_list, insert_slot_to_list,
temp_slots_at_level, max_slot_level, move_slot_to_level,
make_slot_available): New functions.
(assign_stack_temp_for_type, combine_temp_slots,
find_temp_slot_from_address, preserve_temp_slots,
preserve_rtl_expr_result, free_temp_slots,
free_temps_for_rtl_expr, pop_temp_slots): Work with
the new structure of lists.
(mark_all_temps_used): Removed.
* function.h (struct function): Field x_temp_slots
replaced by x_used_temp_slots and x_avail_temp_slots.
(temp_slots): Replaced by ...
(used_temp_slots, avail_temp_slots): New.
* tree.h (mark_all_temps_used): Declaration removed.
* loop-iv.c (mark_single_set, get_biv_step_1, iv_analyze,
simplify_using_assignment): Take the expression out of
the expr_list wrapper.
* loop-iv.c (iv_number_of_iterations): Improve clasification of
infinite loops.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.3695&r2=2.3696
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/function.c.diff?cvsroot=gcc&r1=1.516&r2=1.517
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/function.h.diff?cvsroot=gcc&r1=1.114&r2=1.115
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/loop-iv.c.diff?cvsroot=gcc&r1=2.7&r2=2.8
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/loop-unswitch.c.diff?cvsroot=gcc&r1=1.17&r2=1.18
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/rtl.h.diff?cvsroot=gcc&r1=1.473&r2=1.474
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/simplify-rtx.c.diff?cvsroot=gcc&r1=1.190&r2=1.191
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/stor-layout.c.diff?cvsroot=gcc&r1=1.189&r2=1.190
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree.h.diff?cvsroot=gcc&r1=1.495&r2=1.496
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14692
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug rtl-optimization/14692] [3.5 Regression] ICE in canon_condition
2004-03-23 13:25 [Bug optimization/14692] New: [tree-ssa] ICE in canon_condition falk at debian dot org
` (4 preceding siblings ...)
2004-05-20 18:43 ` [Bug rtl-optimization/14692] " cvs-commit at gcc dot gnu dot org
@ 2004-05-20 19:27 ` pinskia at gcc dot gnu dot org
2004-08-08 23:17 ` cvs-commit at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-20 19:27 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-05-19 19:05 -------
Fixed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14692
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug rtl-optimization/14692] [3.5 Regression] ICE in canon_condition
2004-03-23 13:25 [Bug optimization/14692] New: [tree-ssa] ICE in canon_condition falk at debian dot org
` (5 preceding siblings ...)
2004-05-20 19:27 ` pinskia at gcc dot gnu dot org
@ 2004-08-08 23:17 ` cvs-commit at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-08-08 23:17 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-08-08 23:17 -------
Subject: Bug 14692
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: falk@gcc.gnu.org 2004-08-08 23:17:23
Modified files:
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/gcc.c-torture/compile: pr12517.c pr12578.c
pr12899.c pr14692.c
pr16461.c
Log message:
PR tree-optimization/12517
* gcc.c-torture/compile/pr12517.c: New test.
PR tree-optimization/12578
* gcc.c-torture/compile/pr12578.c: New test.
PR tree-optimization/12899
* gcc.c-torture/compile/pr12899.c: New test.
PR rtl-optimization/14692
* gcc.c-torture/compile/pr14692.c: New test.
PR tree-optimization/16461
* gcc.c-torture/compile/pr16461.c: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4108&r2=1.4109
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/pr12517.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/pr12578.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/pr12899.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/pr14692.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/pr16461.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14692
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2004-08-08 23:17 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-23 13:25 [Bug optimization/14692] New: [tree-ssa] ICE in canon_condition falk at debian dot org
2004-03-23 14:34 ` [Bug optimization/14692] [3.5 Regression] " pinskia at gcc dot gnu dot org
2004-05-09 15:32 ` pinskia at gcc dot gnu dot org
2004-05-09 15:33 ` pinskia at gcc dot gnu dot org
2004-05-11 16:37 ` rakdver at gcc dot gnu dot org
2004-05-20 18:43 ` [Bug rtl-optimization/14692] " cvs-commit at gcc dot gnu dot org
2004-05-20 19:27 ` pinskia at gcc dot gnu dot org
2004-08-08 23:17 ` 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).