opt: Don't emit inline functions from dead code
Inside dead code don't regard inline functions as being referenced.
This commit is contained in:
@ -1170,6 +1170,11 @@ void bool_test()
|
||||
extern int undefined_function(void);
|
||||
extern int defined_function(void);
|
||||
|
||||
static inline void refer_to_undefined(void)
|
||||
{
|
||||
undefined_function();
|
||||
}
|
||||
|
||||
void optimize_out(void)
|
||||
{
|
||||
int i = 0 ? undefined_function() : defined_function();
|
||||
@ -1264,6 +1269,9 @@ void optimize_out(void)
|
||||
else
|
||||
undefined_function();
|
||||
|
||||
if (defined_function() && 0)
|
||||
refer_to_undefined();
|
||||
|
||||
if (1)
|
||||
return;
|
||||
printf ("oor:%d\n", undefined_function());
|
||||
|
||||
Reference in New Issue
Block a user