Issue 129203
Summary [register] clang use redundant mov to avoid clobber return register w0
Labels clang
Assignees
Reporter vfdff
    * test: https://godbolt.org/z/PG9GoMnqo
```
typedef struct {
    int a;
 int b;
} S;

extern S g_info;

__attribute__((noinline))
int foo1(S * s)
{
   int start = g_info.a;
   s->b = 0;

   return g_info.a;
}
```

* Now gcc store the  s->b first and then can load g_info.a into return regiser w0 without redundant mov 
  While clang need the redundant mov as it load g_info.a first, and the register w0 is not released.
  
 - I already use -Wall to report all warning, but the **dangling pointer** is not identified by clang
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to