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

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Zhendong Su from comment #2)
> [659] % gcctk -O1 -S -o O1.s small.c
> [660] % gcctk -O3 -S -o O3.s small.c
> [661] % 
> [661] % wc O1.s O3.s
>   40   86  599 O1.s
>   68  138 1047 O3.s
>  108  224 1646 total
> [662] % 
> [662] % grep foo O1.s
> [663] % grep foo O3.s
>         call    foo
> [664] % 
> [664] % cat small.c
> extern void foo(void);
> int a, b, *c;
> static void d(int f) {
>   if (f)
>     foo();
> }
> static int e(int f) {
>   int g[] = {2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2};
>   int h[60];
>   h[0] = g != c;
>   if (b)
>     while (a) {
>       int *i[1] = {&h[6]};
>     }
>   return f;
> }
> static int *j(int *p) { return 0; }
> int main () {
>   int m = e(0);
>   d(m);
>   int l[8];
>   if (j(l))
>     while (1)
>       ;
>   return 0;
> }

This is a case similar to PR99991, we create a IPA CP clone and fail to inline
that at -O3 while we are happy to IPA inline e() at -O1.

Reply via email to