[Bug tree-optimization/97520] ICE in calc_stmt, at gimple-range.cc:399 with "-O1 -fno-tree-fre -ftree-vrp"

suochenyao at 163 dot com gcc-bugzilla@gcc.gnu.org
Fri Oct 30 15:27:18 GMT 2020


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

--- Comment #6 from suochenyao at 163 dot com <suochenyao at 163 dot com> ---
(In reply to suochenyao@163.com from comment #5)
> *****************************************************************************
> **
> I think this can be reproduced with "-fno-strict-aliasing"...
> I am not sure whether it can be helpful...
> *****************************************************************************
> **
> OS and Platform:
> CentOS Linux release 7.8.2003 (Core), x86_64 GNU/Linux
> *****************************************************************************
> **
> Program:
> int printf(const char *, ...);
> union {
>   long a;
>   int b;
> } c;
> int d=0;
> long e=0;
> long *f = &c.a;
> short g=0;
> int *h = &c.b;
> short i(int j) {
>   g = *h;
>   *f = 3;
>   for (;; e--) {
>     if (*h)
>       return d;
>     *h = j;
>   }
>   return 0;
> }
> int main() {
>   i(1);
>   printf("%d\n", (int)e);
>   return 0;
> }
> *****************************************************************************
> **
> gcc version:
> $ gcc -v
> Using built-in specs.
> COLLECT_GCC=/home/suocy/bin/gcc-dev/bin/gcc
> COLLECT_LTO_WRAPPER=/home/suocy/bin/gcc-dev/libexec/gcc/x86_64-pc-linux-gnu/
> 11.0.0/lto-wrapper
> Target: x86_64-pc-linux-gnu
> Configured with: ../configure --prefix=/home/suocy/bin/gcc-dev/
> --disable-multilib --enable-languages=c,c++
> Thread model: posix
> Supported LTO compression algorithms: zlib
> gcc version 11.0.0 20201029 (experimental) (GCC)
> *****************************************************************************
> **
> Command Lines:
> $ gcc a.c -o a.o1
> $ gcc -Wall -Wextra -fno-strict-aliasing -fwrapv -Og -fgcse
> -fstrict-aliasing a.c -o a.o2
> $ gcc -Og -fgcse -fstrict-aliasing a.c -o a.o3
> $ ./a.o1
> 0
> $ ./a.o2
> -1
> $ ./a.o3
> -1

Sorry, comment to the wrong place...


More information about the Gcc-bugs mailing list