[Bug c/83222] [8 regression] Inconsistent "initializer element is not constant" error

2024-01-29 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83222

Andrew Pinski  changed:

   What|Removed |Added

 CC||bugdal at aerifal dot cx

--- Comment #6 from Andrew Pinski  ---
*** Bug 113653 has been marked as a duplicate of this bug. ***

[Bug c/83222] [8 regression] Inconsistent "initializer element is not constant" error

2017-11-30 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83222

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Jakub Jelinek  ---
Should be fixed now.

[Bug c/83222] [8 regression] Inconsistent "initializer element is not constant" error

2017-11-30 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83222

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Thu Nov 30 23:43:10 2017
New Revision: 255285

URL: https://gcc.gnu.org/viewcvs?rev=255285=gcc=rev
Log:
PR c/83222
* c-tree.h (decl_constant_value_1): Declare.
* c-typeck.c (decl_constant_value_1): New function.
(decl_constant_value): Use it.
* c-fold.c (c_fully_fold_internal): If in_init, use
decl_constant_value_1 instead of decl_constant_value.

* gcc.c-torture/compile/pr83222.c: New test.

Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr83222.c
Modified:
trunk/gcc/c/ChangeLog
trunk/gcc/c/c-fold.c
trunk/gcc/c/c-tree.h
trunk/gcc/c/c-typeck.c
trunk/gcc/testsuite/ChangeLog

[Bug c/83222] [8 regression] Inconsistent "initializer element is not constant" error

2017-11-30 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83222

--- Comment #3 from Jakub Jelinek  ---
Created attachment 42752
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42752=edit
gcc8-pr83222.patch

Perhaps we can do something like this and in initializers try to behave more
consistently even when outside of functions.  Or in the other direction, handle
static var initializers even in functions like those outside of functions.

[Bug c/83222] [8 regression] Inconsistent "initializer element is not constant" error

2017-11-30 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83222

--- Comment #2 from Jakub Jelinek  ---
Well, even GCC 7 and older were doing it, but only with -O1 and above.

[Bug c/83222] [ 8 regression] Inconsistent "initializer element is not constant" error

2017-11-29 Thread ian at airs dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83222

Ian Lance Taylor  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #1 from Ian Lance Taylor  ---
This may be caused by the recent fix for PR 69960.

[Bug c/83222] [ 8 regression] Inconsistent "initializer element is not constant" error

2017-11-29 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83222

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||accepts-invalid
   Target Milestone|--- |8.0
   Severity|critical|normal