fab: Manaully build gimple rather than depend on gimplifier for stdarg functions
This code dates before gimple tuples was around. So it uses both MODIFY_EXPR and
INDIRECT_REF :).
For `__builtin_va_start(ptr, 0)` it exands into:
```
_t = __builtin_next_arg (0);
*ptr = _t;
```
We need to get a new VDEF for the next arg call so we don't need to do a
ssa update too.
For `__builtin_va_copy(ptr, b)`, it expands into:
```
*ptr = b;
```
Which is still a store.
For `__builtin_va_end(ptr)`, we change it into a GIMPLE_NOP.
Before optimize_stdarg_builtin would return a tree and then
pass_fold_builtins::execute would set todo to include
TODO_update_address_taken for a non-null result.
Since now optimize_stdarg_builtin returns a bool, the path that had
set the todo is no longer taken (the result variable is still NULL).
Setting the todo to include TODO_update_address_taken when the call to
optimize_stdarg_builtin succeeds to be able to get the same effect as
before.
That is:
before we had:
```
result = optimize_stdarg_builtin(...);
...
if (!result) continue;
todo |= TODO_update_address_taken;
```
Now after this change we have:
result = NULL_TREE;
...
if (optimize_stdarg_builtin(...))
todo |= TODO_update_address_taken;
if (!result) continue;
```
Also since optimize_stdarg_builtin will remove the part of taking an
address of a local variable and in this case fab is the last pass
where this happens, TODO_update_address_taken is needed to change the
va args in some cases to not forced to memory variables.
Note this code will be moved into gimple_fold later on. This is part of the
reason for updating this code. The other side is this simplifies the code
too.
Changes since v1:
* v2: expand commit message.
gcc/ChangeLog:
* tree-ssa-ccp.cc (optimize_stdarg_builtin): Mannually create the
gimple statements instead of depending on the gimplifier.
(pass_fold_builtins::execute): Handle updated call to optimize_stdarg_builtin.
Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>