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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-07-29
             Status|UNCONFIRMED                 |NEW

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to sasho648 from comment #4)
> More *shocking* example will be:
> 
> struct tx { int a[6], b[6]; } *f();
> 
> void (main)() 
> {
>       int *p = f()->b;
> 
>       if(p == NULL)
>               printf("What?"); 
> }
> 

This one works with GCC 10+.

The first one is still not implemented.
The cast is removed early:
<<cleanup_point <<< Unknown tree: expr_stmt
  (void) (p = p) >>>>>;
So it might be hard to implement.

Confirmed

Reply via email to