[Bug tree-optimization/102892] [12 Regression] Dead Code Elimination Regression at -O3 (trunk vs 11.2.0)

jiawei at iscas dot ac.cn gcc-bugzilla@gcc.gnu.org
Fri Apr 22 03:04:03 GMT 2022


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

jiawei <jiawei at iscas dot ac.cn> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jiawei at iscas dot ac.cn

--- Comment #11 from jiawei <jiawei at iscas dot ac.cn> ---
(In reply to Eric Botcazou from comment #8)
I use the RISC-V target test and get the same result, and link fail with
'undefined reference to `foo`'.

> The test fails (to link) on SPARC though, here's the .optimized dump at -O3:
> 
> ;; Function main (main, funcdef_no=0, decl_uid=1488, cgraph_uid=1,
> symbol_order=1) (executed once)
> 
> Removing basic block 8
> Removing basic block 9
> Removing basic block 10
> Removing basic block 11
> int main ()
> {
>   unsigned int ivtmp.8;
>   long int a;
>   long int _1;
>   void * _2;
>   unsigned int _17;
> 
>   <bb 2> [local count: 44232128]:
>   if (a_9(D) != 1)
>     goto <bb 6>; [89.00%]
>   else
>     goto <bb 7>; [11.00%]
> 
>   <bb 3> [local count: 715863673]:
>   # ivtmp.8_23 = PHI <ivtmp.8_24(5), ivtmp.8_7(6)>
>   bar ();
>   _2 = (void *) ivtmp.8_23;
>   _1 = MEM[(long int *)_2];
>   if (_1 == 1)
>     goto <bb 4>; [20.24%]
>   else
>     goto <bb 5>; [79.76%]
> 
>   <bb 4> [local count: 144890806]:
>   foo ();
> 
>   <bb 5> [local count: 715863674]:
>   ivtmp.8_24 = ivtmp.8_23 + 4;
>   if (_17 != ivtmp.8_24)
>     goto <bb 3>; [66.67%]
>   else
>     goto <bb 7>; [33.33%]
> 
>   <bb 6> [local count: 238597362]:
>   ivtmp.8_7 = (unsigned int) &b;
>   _17 = ivtmp.8_7 + 8;
>   goto <bb 3>; [100.00%]
> 
>   <bb 7> [local count: 44232131]:
>   return 0;
> }


More information about the Gcc-bugs mailing list