This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] no lowering of &a.b (and &a->b) in the C/C++ front-ends


Andrew Pinski <pinskia@physics.uc.edu> writes:

> ChangeLog:
> 	* c-typeck.c (build_unary_op): Use &a.b if the foldded lowered
> 	expression is not constant.
> 	(c_finish_return): Do not go through INDIRECT_REF when looking
> 	for the inner expression of an ADDR_EXPR for warning about.
>
> cp/ChangeLog:
> 	* typeck.c (build_unary_op): Use &a.b if the foldded lowered
> 	expression is not constant.
>
> testsuite/ChangeLog:
> 	* g++.dg/opt/pr14029.C: New test.
> 	* gcc.c-torture/execute/pr15262.c: New test.

OK with following grammar nitpicks:

[c-typeck.c]
> +	    /* If we don't have constant address with the foldded PLUS_EXPR
> +	       then we should use the address expression instead.  */

            /* If the folded PLUS_EXPR is not a constant address, wrap
               it in an ADDR_EXPR.  */

[cp/typeck.c]
> +	    /* If we don't have constant address with the foldded PLUS_EXPR
> +	       then we should use the address expression instead.  */

same here.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]