On Mon, Dec 7, 2015 at 7:23 AM, Joseph Myers wrote:
> On Mon, 7 Dec 2015, Patrick Palka wrote:
>
>> To fix this inconsistency, this patch calls decl_constant_value in
>> c_fully fold after folding the given expression.
>
> The aim should be to eliminate decl_constant_value use here once all
> fold
On Mon, Dec 7, 2015 at 7:20 AM, Marek Polacek wrote:
> On Sun, Dec 06, 2015 at 11:50:15PM -0500, Patrick Palka wrote:
>> diff --git a/gcc/c/c-fold.c b/gcc/c/c-fold.c
>> index c554e17..ab0b37f 100644
>> --- a/gcc/c/c-fold.c
>> +++ b/gcc/c/c-fold.c
>> @@ -88,6 +88,7 @@ c_fully_fold (tree expr, bool
On Sun, Dec 6, 2015 at 11:50 PM, Patrick Palka wrote:
> There is a minor inconsistency in the folding behavior within the C
> frontend. The C frontend does not currently fold the expression "x",
> where x is a const int, yet the FE does fold the expression "x + 0".
>
> This happens because decl_c
On Mon, 7 Dec 2015, Patrick Palka wrote:
> To fix this inconsistency, this patch calls decl_constant_value in
> c_fully fold after folding the given expression.
The aim should be to eliminate decl_constant_value use here once all
folding optimizations are also done on GIMPLE (and generally reduc
On Sun, Dec 06, 2015 at 11:50:15PM -0500, Patrick Palka wrote:
> diff --git a/gcc/c/c-fold.c b/gcc/c/c-fold.c
> index c554e17..ab0b37f 100644
> --- a/gcc/c/c-fold.c
> +++ b/gcc/c/c-fold.c
> @@ -88,6 +88,7 @@ c_fully_fold (tree expr, bool in_init, bool *maybe_const)
> }
>ret = c_fully_fold_
On Sun, Dec 6, 2015 at 11:50 PM, Patrick Palka wrote:
> There is a minor inconsistency in the folding behavior within the C
> frontend. The C frontend does not currently fold the expression "x",
> where x is a const int, yet the FE does fold the expression "x + 0".
>
> This happens because decl_c
There is a minor inconsistency in the folding behavior within the C
frontend. The C frontend does not currently fold the expression "x",
where x is a const int, yet the FE does fold the expression "x + 0".
This happens because decl_constant_value is called in c_fully_fold only
while recursing ove