[Bug c/102502] C11: _Static_assert disallows const int operand in -O0 while allows it in higher -O

2021-09-27 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102502 --- Comment #5 from Jakub Jelinek --- (In reply to Andrew Pinski from comment #4) > (In reply to Jakub Jelinek from comment #2) > > Why do you think it is a bug? > > Because there were other bugs which were fixed where there was an > inconsiste

[Bug c/102502] C11: _Static_assert disallows const int operand in -O0 while allows it in higher -O

2021-09-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102502 --- Comment #4 from Andrew Pinski --- (In reply to Jakub Jelinek from comment #2) > Why do you think it is a bug? Because there were other bugs which were fixed where there was an inconsistency, PR 66618, and PR 71983 for an example. There are

[Bug c/102502] C11: _Static_assert disallows const int operand in -O0 while allows it in higher -O

2021-09-27 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102502 --- Comment #3 from Fangrui Song --- OK, Andrew asked me to file it :) I just wanted to fix glibc and run away from the GCC inconsistency. I know that https://www.iso-9899.info/n1570.html#6.6 p10 says "An implementation may accept other forms o

[Bug c/102502] C11: _Static_assert disallows const int operand in -O0 while allows it in higher -O

2021-09-27 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102502 --- Comment #2 from Jakub Jelinek --- Why do you think it is a bug? This is not valid C11 code, and as an extension gcc when optimizations enabled in some cases will accept in constant expressions even something that it doesn't have to. With -pe

[Bug c/102502] C11: _Static_assert disallows const int operand in -O0 while allows it in higher -O

2021-09-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102502 --- Comment #1 from Andrew Pinski --- Can you attach the preprocessed source?