diff mbox series

[07/14] reject_gcc_builtin: strip any location wrappers

Message ID 1510350329-48956-8-git-send-email-dmalcolm@redhat.com
State New
Headers show
Series Preserving locations for variable-uses and constants (PR 43486) | expand

Commit Message

David Malcolm Nov. 10, 2017, 9:45 p.m. UTC
Otherwise pr70144-1.c breaks.

gcc/c-family/ChangeLog:
	* c-common.c (reject_gcc_builtin): Strip any location from EXPR.
---
 gcc/c-family/c-common.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jason Merrill Dec. 11, 2017, 11:38 p.m. UTC | #1
On 11/10/2017 04:45 PM, David Malcolm wrote:
> Otherwise pr70144-1.c breaks.
> 
> gcc/c-family/ChangeLog:
> 	* c-common.c (reject_gcc_builtin): Strip any location from EXPR.
> ---
>   gcc/c-family/c-common.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
> index 24077c7..739c54e 100644
> --- a/gcc/c-family/c-common.c
> +++ b/gcc/c-family/c-common.c
> @@ -7774,6 +7774,8 @@ pointer_to_zero_sized_aggr_p (tree t)
>   bool
>   reject_gcc_builtin (const_tree expr, location_t loc /* = UNKNOWN_LOCATION */)
>   {
> +  STRIP_ANY_LOCATION_WRAPPER (expr);
> +
>     if (TREE_CODE (expr) == ADDR_EXPR)
>       expr = TREE_OPERAND (expr, 0);

Don't you want to strip the wrapper after we strip the ADDR_EXPR?  OK 
with that change.

Jason
diff mbox series

Patch

diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 24077c7..739c54e 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -7774,6 +7774,8 @@  pointer_to_zero_sized_aggr_p (tree t)
 bool
 reject_gcc_builtin (const_tree expr, location_t loc /* = UNKNOWN_LOCATION */)
 {
+  STRIP_ANY_LOCATION_WRAPPER (expr);
+
   if (TREE_CODE (expr) == ADDR_EXPR)
     expr = TREE_OPERAND (expr, 0);