[Bug c++/85153] _Pragma to disable -Wswitch-unreachable diagnostic not properly working when used within preprocessor macro

2018-10-09 Thread peter.maydell at linaro dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85153

Peter Maydell  changed:

   What|Removed |Added

 CC||peter.maydell at linaro dot org

--- Comment #5 from Peter Maydell  ---
I was looking to see if this bug had been fixed in gcc trunk, and if you tell
godbolt to run the non-preprocessed original code on gcc trunk (ie the source
you get by following the godbolt link in comment 1), the compiler ICEs:

: In function 'int test7(int)':

:76:5: internal compiler error: in linemap_macro_map_loc_to_exp_point,
at libcpp/line-map.c:1063

76 | switch (val) {

   | ^~

Please submit a full bug report,

with preprocessed source if appropriate.

See <https://gcc.gnu.org/bugs/> for instructions.

Compiler returned: 1


(There are a whole set of these "_Pragma() to disable diagnostics doesn't do
the right thing" bugs in bugzilla. So far I have seen test cases which have
been fixed in gcc 8, test cases fixed in trunk but not 8, and this one which is
differently-broken in trunk. So there isn't a single underlying bug in all
cases.)

[Bug preprocessor/83256] inconsistent _Pragma behavior in multi-line macros

2018-10-09 Thread peter.maydell at linaro dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83256

Peter Maydell  changed:

   What|Removed |Added

 CC||peter.maydell at linaro dot org

--- Comment #1 from Peter Maydell  ---
I was investigating a similar gcc bug, and was pointed at this one. I note that
the test case attached to this bug seems to be (according to the godbolt
compilers) broken in gcc 7.3 but fixed by 8.1.

8.1 didn't fix everything in this area, though -- I have a rather similar kind
of test case (which I'll attach), which seems to be still broken in 8.3 but
fixed in gcc trunk.

[Bug preprocessor/83256] inconsistent _Pragma behavior in multi-line macros

2018-10-09 Thread peter.maydell at linaro dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83256

--- Comment #2 from Peter Maydell  ---
Created attachment 44817
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44817=edit
repro for similar bug, apparently broken up to 8.3 but fixed in trunk?