re PR c/83801 ([avr] String constant in __flash not put into .progmem)
authorJakub Jelinek <jakub@redhat.com>
Sat, 13 Jan 2018 17:00:43 +0000 (18:00 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sat, 13 Jan 2018 17:00:43 +0000 (18:00 +0100)
commitb4923738ef57a441f6f9248260848bde5af165fa
tree5e1b4802d2cab1d24b857680da9e4057d37fc2d7
parent567a6e1cdb3cae09ae74bdd528fd31c0b4956ad2
re PR c/83801 ([avr] String constant in __flash not put into .progmem)

PR c/83801
* c-tree.h (decl_constant_value_1): Add a bool argument.
* c-typeck.c (decl_constant_value_1): Add IN_INIT argument, allow
returning a CONSTRUCTOR if it is true.  Use error_operand_p.
(decl_constant_value): Adjust caller.
* c-fold.c (c_fully_fold_internal): If in_init, pass true to
decl_constant_value_1 as IN_INIT.  Otherwise, punt if
decl_constant_value returns initializer that has BLKmode or
array type.
(c_fully_fold_internal) <case COMPONENT_REF>: Fold if !lval.

* gcc.dg/pr83801.c: New test.

From-SVN: r256608
gcc/c/ChangeLog
gcc/c/c-fold.c
gcc/c/c-tree.h
gcc/c/c-typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr83801.c [new file with mode: 0644]