* [Bug lto/54980] [4.8 regression] gimple check: expected gimple_cond(error_mark), have gimple_call() in gimple_cond_set_lhs, at gimple.h:2578
2012-10-18 22:52 [Bug lto/54980] New: [4.8 regression] gimple check: expected gimple_cond(error_mark), have gimple_call() in gimple_cond_set_lhs, at gimple.h:2578 dimhen at gmail dot com
@ 2012-10-18 23:06 ` dimhen at gmail dot com
2012-10-18 23:51 ` dimhen at gmail dot com
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: dimhen at gmail dot com @ 2012-10-18 23:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54980
--- Comment #1 from Dmitry G. Dyachenko <dimhen at gmail dot com> 2012-10-18 23:05:38 UTC ---
192502 OK
$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/local/gcc_current_192502/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /home/dimhen/src/gcc-current/configure
--prefix=/usr/local/gcc_current --enable-__cxa_atexit --enable-shared
--enable-checking=yes,df,fold,rtl,tree --enable-gnu-unique-object
--enable-linker-build-id --enable-languages=c,c++,lto --enable-plugin
--enable-version-specific-runtime-libs --with-tune=native
Thread model: posix
gcc version 4.8.0 20121016 (experimental) [trunk revision 192502] (GCC)
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug lto/54980] [4.8 regression] gimple check: expected gimple_cond(error_mark), have gimple_call() in gimple_cond_set_lhs, at gimple.h:2578
2012-10-18 22:52 [Bug lto/54980] New: [4.8 regression] gimple check: expected gimple_cond(error_mark), have gimple_call() in gimple_cond_set_lhs, at gimple.h:2578 dimhen at gmail dot com
2012-10-18 23:06 ` [Bug lto/54980] " dimhen at gmail dot com
@ 2012-10-18 23:51 ` dimhen at gmail dot com
2012-10-19 0:09 ` dimhen at gmail dot com
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: dimhen at gmail dot com @ 2012-10-18 23:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54980
--- Comment #2 from Dmitry G. Dyachenko <dimhen at gmail dot com> 2012-10-18 23:51:33 UTC ---
more reduced
$ cat 1.ii
extern "C" class A
{
};
template < int (*t_parser) () > class B
{
virtual int parse ()
{
A a;
t_parser ();
}
};
extern "C" int f ();
class C:B < f >
{
};
void
g ()
{
new C;
}
$ cat 2.ii
extern "C"
{
void printf (const char *...);
int f ();
}
const char *a[] = { "", 0 };
int b;
int
f ()
{
while (1)
switch (b)
case 'h':
{
int i;
while (a[0])
printf (a[i++]);
}
}
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug lto/54980] [4.8 regression] gimple check: expected gimple_cond(error_mark), have gimple_call() in gimple_cond_set_lhs, at gimple.h:2578
2012-10-18 22:52 [Bug lto/54980] New: [4.8 regression] gimple check: expected gimple_cond(error_mark), have gimple_call() in gimple_cond_set_lhs, at gimple.h:2578 dimhen at gmail dot com
2012-10-18 23:06 ` [Bug lto/54980] " dimhen at gmail dot com
2012-10-18 23:51 ` dimhen at gmail dot com
@ 2012-10-19 0:09 ` dimhen at gmail dot com
2012-10-19 8:39 ` rguenth at gcc dot gnu.org
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: dimhen at gmail dot com @ 2012-10-19 0:09 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54980
--- Comment #3 from Dmitry G. Dyachenko <dimhen at gmail dot com> 2012-10-19 00:08:54 UTC ---
and more
$ cat 1.ii
class A
{
};
template < int (*t_parser) () > class B
{
virtual int parse ()
{
A a;
t_parser ();
}
};
extern "C" int f ();
class C:B < f >
{
};
void
g ()
{
new C;
}
$ cat 2.ii
extern "C" int f ();
char *a[] = { 0, 0 };
void bar (char *);
int
f ()
{
int i;
while (1)
bar (a[i++]);
}
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug lto/54980] [4.8 regression] gimple check: expected gimple_cond(error_mark), have gimple_call() in gimple_cond_set_lhs, at gimple.h:2578
2012-10-18 22:52 [Bug lto/54980] New: [4.8 regression] gimple check: expected gimple_cond(error_mark), have gimple_call() in gimple_cond_set_lhs, at gimple.h:2578 dimhen at gmail dot com
` (2 preceding siblings ...)
2012-10-19 0:09 ` dimhen at gmail dot com
@ 2012-10-19 8:39 ` rguenth at gcc dot gnu.org
2012-10-19 10:27 ` dimhen at gmail dot com
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-10-19 8:39 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54980
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-10-19
CC| |hubicka at gcc dot gnu.org
Target Milestone|--- |4.8.0
Ever Confirmed|0 |1
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> 2012-10-19 08:38:24 UTC ---
Honza, this is yours.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug lto/54980] [4.8 regression] gimple check: expected gimple_cond(error_mark), have gimple_call() in gimple_cond_set_lhs, at gimple.h:2578
2012-10-18 22:52 [Bug lto/54980] New: [4.8 regression] gimple check: expected gimple_cond(error_mark), have gimple_call() in gimple_cond_set_lhs, at gimple.h:2578 dimhen at gmail dot com
` (3 preceding siblings ...)
2012-10-19 8:39 ` rguenth at gcc dot gnu.org
@ 2012-10-19 10:27 ` dimhen at gmail dot com
2012-10-20 14:28 ` dimhen at gmail dot com
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: dimhen at gmail dot com @ 2012-10-19 10:27 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54980
--- Comment #5 from Dmitry G. Dyachenko <dimhen at gmail dot com> 2012-10-19 10:26:35 UTC ---
192517 OK
192548 FAIL
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug lto/54980] [4.8 regression] gimple check: expected gimple_cond(error_mark), have gimple_call() in gimple_cond_set_lhs, at gimple.h:2578
2012-10-18 22:52 [Bug lto/54980] New: [4.8 regression] gimple check: expected gimple_cond(error_mark), have gimple_call() in gimple_cond_set_lhs, at gimple.h:2578 dimhen at gmail dot com
` (4 preceding siblings ...)
2012-10-19 10:27 ` dimhen at gmail dot com
@ 2012-10-20 14:28 ` dimhen at gmail dot com
2012-10-23 14:48 ` hubicka at gcc dot gnu.org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: dimhen at gmail dot com @ 2012-10-20 14:28 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54980
--- Comment #6 from Dmitry G. Dyachenko <dimhen at gmail dot com> 2012-10-20 14:28:28 UTC ---
192529 OK
192538 FAIL
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug lto/54980] [4.8 regression] gimple check: expected gimple_cond(error_mark), have gimple_call() in gimple_cond_set_lhs, at gimple.h:2578
2012-10-18 22:52 [Bug lto/54980] New: [4.8 regression] gimple check: expected gimple_cond(error_mark), have gimple_call() in gimple_cond_set_lhs, at gimple.h:2578 dimhen at gmail dot com
` (5 preceding siblings ...)
2012-10-20 14:28 ` dimhen at gmail dot com
@ 2012-10-23 14:48 ` hubicka at gcc dot gnu.org
2012-10-24 9:58 ` dimhen at gmail dot com
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: hubicka at gcc dot gnu.org @ 2012-10-23 14:48 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54980
--- Comment #7 from Jan Hubicka <hubicka at gcc dot gnu.org> 2012-10-23 14:48:05 UTC ---
This does not seem to reproduce for me. The following patch should however fix
it.
Index: tree-ssa-loop-ivcanon.c
===================================================================
--- tree-ssa-loop-ivcanon.c (revision 192711)
+++ tree-ssa-loop-ivcanon.c (working copy)
@@ -364,6 +364,10 @@ loop_edge_to_cancel (struct loop *loop)
else
edge_to_cancel = EDGE_SUCC (edge_to_cancel->src, 0);
+ /* We only can handle conditionals. */
+ if (!(edge_to_cancel->flags & (EDGE_TRUE_VALUE | EDGE_FALSE_VALUE)))
+ continue;
+
/* We should never have conditionals in the loop latch. */
gcc_assert (edge_to_cancel->dest != loop->header);
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug lto/54980] [4.8 regression] gimple check: expected gimple_cond(error_mark), have gimple_call() in gimple_cond_set_lhs, at gimple.h:2578
2012-10-18 22:52 [Bug lto/54980] New: [4.8 regression] gimple check: expected gimple_cond(error_mark), have gimple_call() in gimple_cond_set_lhs, at gimple.h:2578 dimhen at gmail dot com
` (6 preceding siblings ...)
2012-10-23 14:48 ` hubicka at gcc dot gnu.org
@ 2012-10-24 9:58 ` dimhen at gmail dot com
2012-10-24 10:01 ` dimhen at gmail dot com
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: dimhen at gmail dot com @ 2012-10-24 9:58 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54980
--- Comment #8 from Dmitry G. Dyachenko <dimhen at gmail dot com> 2012-10-24 09:58:31 UTC ---
i re-check 192757
--enable-checking=release FAIL with
$ bash -x tf.sh
+ g++ -flto -fpreprocessed -c 1.ii -o 1.o
+ g++ -flto -O1 -fpreprocessed -c 2.ii -o 2.o
+ g++ -Ofast -flto -o t 1.o 2.o
In file included from :0:0:
1.ii: In member function 'parse':
1.ii:6:17: internal compiler error: Segmentation fault
virtual int parse ()
^
0x7539bf crash_signal
/home/dimhen/src/gcc-current/gcc/toplev.c:335
0x5fd754 internal_fn_flags
/home/dimhen/src/gcc-current/gcc/internal-fn.h:48
0x5fd754 gimple_call_flags(gimple_statement_d const*)
/home/dimhen/src/gcc-current/gcc/gimple.c:1883
0x80262f gimple_call_noreturn_p
/home/dimhen/src/gcc-current/gcc/gimple.h:2413
0x80262f update_stmt_operands(gimple_statement_d*)
/home/dimhen/src/gcc-current/gcc/tree-ssa-operands.c:1082
0xb136b6 update_stmt
/home/dimhen/src/gcc-current/gcc/gimple.h:1531
0xb136b6 try_unroll_loop_completely
/home/dimhen/src/gcc-current/gcc/tree-ssa-loop-ivcanon.c:552
0xb136b6 canonicalize_loop_induction_variables
/home/dimhen/src/gcc-current/gcc/tree-ssa-loop-ivcanon.c:670
0xb1487e tree_unroll_loops_completely(bool, bool)
/home/dimhen/src/gcc-current/gcc/tree-ssa-loop-ivcanon.c:833
--enable-checking=yes,df,fold,rtl,tree FAIL as
1.ii: In member function 'parse':
1.ii:6:17: internal compiler error: gimple check: expected
gimple_cond(error_mark), have gimple_call() in gimple_cond_set_lhs, at
gimple.h:2553
virtual int parse ()
^
0x6b1063 gimple_check_failed(gimple_statement_d const*, char const*, int, char
const*, gimple_code, tree_code)
/home/dimhen/src/gcc-current/gcc/gimple.c:1160
0x107fe69 gimple_cond_set_lhs
/home/dimhen/src/gcc-current/gcc/gimple.h:2553
0x107f448 gimple_cond_set_lhs
/home/dimhen/src/gcc-current/gcc/tree-ssa-loop-ivcanon.c:536
0x107f448 gimple_cond_make_true
/home/dimhen/src/gcc-current/gcc/gimple.h:2649
0x107f448 try_unroll_loop_completely
/home/dimhen/src/gcc-current/gcc/tree-ssa-loop-ivcanon.c:551
0x107f448 canonicalize_loop_induction_variables
/home/dimhen/src/gcc-current/gcc/tree-ssa-loop-ivcanon.c:670
0x107f982 tree_unroll_loops_completely(bool, bool)
/home/dimhen/src/gcc-current/gcc/tree-ssa-loop-ivcanon.c:833
$ cat 1.ii
class A
{
};
template < int (*t_parser) () > class B
{
virtual int parse ()
{
A a;
t_parser ();
}
};
extern "C" int f ();
class C:B < f >
{
};
void
g ()
{
new C;
}
$ cat 2.ii
extern "C" int f ();
char *a[] = { 0, 0 };
void bar (char *);
int
f ()
{
int i;
while (1)
bar (a[i++]);
}
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug lto/54980] [4.8 regression] gimple check: expected gimple_cond(error_mark), have gimple_call() in gimple_cond_set_lhs, at gimple.h:2578
2012-10-18 22:52 [Bug lto/54980] New: [4.8 regression] gimple check: expected gimple_cond(error_mark), have gimple_call() in gimple_cond_set_lhs, at gimple.h:2578 dimhen at gmail dot com
` (7 preceding siblings ...)
2012-10-24 9:58 ` dimhen at gmail dot com
@ 2012-10-24 10:01 ` dimhen at gmail dot com
2012-10-24 12:50 ` dimhen at gmail dot com
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: dimhen at gmail dot com @ 2012-10-24 10:01 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54980
--- Comment #9 from Dmitry G. Dyachenko <dimhen at gmail dot com> 2012-10-24 10:00:18 UTC ---
(In reply to comment #7)
> This does not seem to reproduce for me. The following patch should however fix
> it.
> Index: tree-ssa-loop-ivcanon.c
> ===================================================================
> --- tree-ssa-loop-ivcanon.c (revision 192711)
> +++ tree-ssa-loop-ivcanon.c (working copy)
> @@ -364,6 +364,10 @@ loop_edge_to_cancel (struct loop *loop)
> else
> edge_to_cancel = EDGE_SUCC (edge_to_cancel->src, 0);
>
> + /* We only can handle conditionals. */
> + if (!(edge_to_cancel->flags & (EDGE_TRUE_VALUE | EDGE_FALSE_VALUE)))
> + continue;
> +
> /* We should never have conditionals in the loop latch. */
> gcc_assert (edge_to_cancel->dest != loop->header);
i'll try patch. Thank You
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug lto/54980] [4.8 regression] gimple check: expected gimple_cond(error_mark), have gimple_call() in gimple_cond_set_lhs, at gimple.h:2578
2012-10-18 22:52 [Bug lto/54980] New: [4.8 regression] gimple check: expected gimple_cond(error_mark), have gimple_call() in gimple_cond_set_lhs, at gimple.h:2578 dimhen at gmail dot com
` (8 preceding siblings ...)
2012-10-24 10:01 ` dimhen at gmail dot com
@ 2012-10-24 12:50 ` dimhen at gmail dot com
2012-10-25 14:52 ` hubicka at gcc dot gnu.org
2012-10-27 16:49 ` dimhen at gmail dot com
11 siblings, 0 replies; 13+ messages in thread
From: dimhen at gmail dot com @ 2012-10-24 12:50 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54980
--- Comment #10 from Dmitry G. Dyachenko <dimhen at gmail dot com> 2012-10-24 12:50:01 UTC ---
(In reply to comment #7)
> This does not seem to reproduce for me. The following patch should however fix
> it.
> Index: tree-ssa-loop-ivcanon.c
> ===================================================================
> --- tree-ssa-loop-ivcanon.c (revision 192711)
> +++ tree-ssa-loop-ivcanon.c (working copy)
> @@ -364,6 +364,10 @@ loop_edge_to_cancel (struct loop *loop)
> else
> edge_to_cancel = EDGE_SUCC (edge_to_cancel->src, 0);
>
> + /* We only can handle conditionals. */
> + if (!(edge_to_cancel->flags & (EDGE_TRUE_VALUE | EDGE_FALSE_VALUE)))
> + continue;
> +
> /* We should never have conditionals in the loop latch. */
> gcc_assert (edge_to_cancel->dest != loop->header);
192761 + patch
- pass bootstrap with --enable-checking=yes,df,fold,rtl,tree
- test from PR PASS
Thank You!
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug lto/54980] [4.8 regression] gimple check: expected gimple_cond(error_mark), have gimple_call() in gimple_cond_set_lhs, at gimple.h:2578
2012-10-18 22:52 [Bug lto/54980] New: [4.8 regression] gimple check: expected gimple_cond(error_mark), have gimple_call() in gimple_cond_set_lhs, at gimple.h:2578 dimhen at gmail dot com
` (9 preceding siblings ...)
2012-10-24 12:50 ` dimhen at gmail dot com
@ 2012-10-25 14:52 ` hubicka at gcc dot gnu.org
2012-10-27 16:49 ` dimhen at gmail dot com
11 siblings, 0 replies; 13+ messages in thread
From: hubicka at gcc dot gnu.org @ 2012-10-25 14:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54980
--- Comment #11 from Jan Hubicka <hubicka at gcc dot gnu.org> 2012-10-25 14:52:37 UTC ---
Author: hubicka
Date: Thu Oct 25 14:52:32 2012
New Revision: 192809
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192809
Log:
PR tree-optimize/54980
* tree-ssa-loop-ivcanon.c (constant_after_peeling): Fix
obvious typo.
(loop_edge_to_cancel): Be sure that the edge is from an conditional
so we can cancel it.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-ssa-loop-ivcanon.c
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug lto/54980] [4.8 regression] gimple check: expected gimple_cond(error_mark), have gimple_call() in gimple_cond_set_lhs, at gimple.h:2578
2012-10-18 22:52 [Bug lto/54980] New: [4.8 regression] gimple check: expected gimple_cond(error_mark), have gimple_call() in gimple_cond_set_lhs, at gimple.h:2578 dimhen at gmail dot com
` (10 preceding siblings ...)
2012-10-25 14:52 ` hubicka at gcc dot gnu.org
@ 2012-10-27 16:49 ` dimhen at gmail dot com
11 siblings, 0 replies; 13+ messages in thread
From: dimhen at gmail dot com @ 2012-10-27 16:49 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54980
Dmitry G. Dyachenko <dimhen at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #12 from Dmitry G. Dyachenko <dimhen at gmail dot com> 2012-10-27 16:49:31 UTC ---
fixed in 192809
^ permalink raw reply [flat|nested] 13+ messages in thread