https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68906

--- Comment #3 from Yuri Rumyantsev <ysrumyan at gmail dot com> ---
I've prepared simple fix which cures ICE. I will send it for review tomorrow.

2015-12-15 12:50 GMT+03:00 jakub at gcc dot gnu.org <gcc-bugzi...@gcc.gnu.org>:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68906
>
> Jakub Jelinek <jakub at gcc dot gnu.org> changed:
>
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |jakub at gcc dot gnu.org
>
> --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> This doesn't look to me like a mere omission to invalidate debug stmts after
> some stmt move that (correctly) has not considered debug stmts when 
> determining
> if they should be moved or not, but it looks to me like wrong-code
> transformation.
> Before unswitch, if c is non-zero, we have endless loop, but during 
> unswitching
> it is wrongly changed to branch to the bb that returns instead.
> Say if you compile with -O3 (no -g):
> int a;
> volatile int b;
> short c, d;
> int
> fn1 ()
> {
>   int e;
>   for (;;)
>     {
>       a = 3;
>       if (c)
>         continue;
>       e = 0;
>       for (; e > -30; e--)
>         if (b)
>           {
>             int f = e;
>             return d;
>           }
>     }
> }
>
> int
> main ()
> {
>   c = 1;
>   asm volatile ("" : : "m" (c) : "memory");
>   fn1 ();
>   __builtin_abort ();
> }
>
> then before the change this would just hang (expected), now it aborts instead.
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.

Reply via email to