[Bug c/56824] New: pragma GCC diagnostic push/pop regression for GCC diagnostic ignored "-Waggregate-return"
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56824 Bug #: 56824 Summary: pragma GCC diagnostic push/pop regression for GCC diagnostic ignored "-Waggregate-return" Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassig...@gcc.gnu.org ReportedBy: magnus.ref...@gmail.com Created attachment 29784 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29784 Simple testcase If the aggregate-return warning is silenced using #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Waggregate-return" and then, after a line that triggers the warning, the diagnostics are restored using #pragma GCC diagnostic pop , gcc 4.8 issues an aggregate-return warning. This was not the case in versions 4.6 or 4.7. With the attached test case, the following is printed: $ /opt/gcc-4.7/bin/gcc --version gcc (GCC) 4.7.0 Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ /opt/gcc-4.7/bin/gcc -Waggregate-return -c aggregate-return.c $ /opt/gcc-4.8/bin/gcc --version gcc (GCC) 4.8.0 Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ /opt/gcc-4.8/bin/gcc -Waggregate-return -c aggregate-return.c aggregate-return.c: In function ‘main’: aggregate-return.c:8:13: warning: function call has aggregate value [-Waggregate-return] struct foo f = aggregate_return(); ^ $ No warning is printed by either version if the "GCC diagnostic pop" is left out. This regression does not affect (at least some) other warnings, e.g. the following test case: #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-variable" int main(int argc, char* argv[]) { int i; return 0; } #pragma GCC diagnostic pop does not print a warning when compiled with "/opt/gcc-4.8/bin/gcc -Wunused-variable -c unused.c".
[Bug c/56824] pragma GCC diagnostic push/pop regression for GCC diagnostic ignored "-Waggregate-return"
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56824 Magnus Reftel changed: What|Removed |Added Attachment #29784|0 |1 is obsolete|| --- Comment #1 from Magnus Reftel 2013-04-03 07:45:33 UTC --- Created attachment 29785 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29785 Slightly tweaked version of the testcase
[Bug c/56824] pragma GCC diagnostic push/pop regression for GCC diagnostic ignored "-Waggregate-return"
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56824 Magnus Reftel changed: What|Removed |Added Keywords||diagnostic --- Comment #2 from Magnus Reftel 2013-04-10 08:10:44 UTC --- The problem also occurs when "-x c++" is specified, so it's not limited to C only. I can't find any better component for the bug than C, so I'll leave it here for now. Please move it if there's a better component.
[Bug c/56824] pragma GCC diagnostic push/pop regression for GCC diagnostic ignored "-Waggregate-return"
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56824 --- Comment #4 from Magnus Reftel 2013-04-12 07:42:50 UTC --- Thanks for working on this! While the change (when applied to 4.8 as released) does make the erroneous print go away, it makes gcc hang with 100% CPU usage if the "diagnostic ignored" is commented out, like so: /* gcc -Waggregate-return -c aggregate-return.c */ struct foo { int i;}; struct foo aggregate_return(void); #pragma GCC diagnostic push /*#pragma GCC diagnostic ignored "-Waggregate-return"*/ int main(int argc, char* argv[]) { aggregate_return(); return 0; } #pragma GCC diagnostic pop
[Bug gcov-profile/57234] New: gcov 4.7.3 segfaults when reading Clang's .gc* files.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57234 Bug ID: 57234 Summary: gcov 4.7.3 segfaults when reading Clang's .gc* files. Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: gcov-profile Assignee: unassigned at gcc dot gnu.org Reporter: magnus.reftel at gmail dot com Created attachment 30087 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30087&action=edit hello world and its .gc* files which makes gcov segfault Gcov segfaults when reading .gc* files produced by Clang from trunk. Whether Clang generates correct files or not is a separate issue (I'm filing a bug on Clang for that). The issue here is that gcov segfaults at all instead of handling the error cleanly. I'm attaching a tar.gz with a hello world program and .gcno and .gcda files that make gcov 4.7.3 segfault when run as "gcov hello.c".
[Bug gcov-profile/57234] gcov 4.7.3 segfaults when reading Clang's .gc* files.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57234 --- Comment #1 from Magnus Reftel --- For reference: the Clang bug got ID 15954.
[Bug gcov-profile/57234] gcov 4.7.3 segfaults when reading Clang's .gc* files.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57234 --- Comment #3 from Magnus Reftel --- I understand that gcov has no reason to handle coverage files written by anything other than its matching GCC version, but is a segfault a valid response to reading a malformed input file?
[Bug c/56824] pragma GCC diagnostic push/pop regression for GCC diagnostic ignored "-Waggregate-return"
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56824 Magnus Reftel changed: What|Removed |Added Known to work||4.7.3 Known to fail||4.8.1, 4.9.0 --- Comment #6 from Magnus Reftel --- Re-tested with 4.8.1 and MacPorts experimental gcc49 version 4.9-20130728_1. Both fail. 4.7.3 works.
[Bug preprocessor/56824] [4.8/4.9 regression] pragma GCC diagnostic push/pop fail with GCC diagnostic ignored "-Waggregate-return"
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56824 --- Comment #9 from Magnus Reftel --- Thanks for the patch! I applied it on top of 53c3c39b96df9c6a6368bf0d6acfd28a7af3cb63 and tested. Without the patch, the error was still printed when compiling the testcase. With the patch, the error was not printed. Removing the "#pragma GCC diagnostic ignored" made the error print again, as expected. The fix is thus working as it should on the testcase. I no longer have access to the code base where the problem was discovered, so I guess this verification will have to do. I'm not sure what the criteria for updating the status field are, though, so I leave it at "ASSIGNED".
[Bug preprocessor/56824] [4.8 regression] pragma GCC diagnostic push/pop fail with GCC diagnostic ignored "-Waggregate-return"
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56824 --- Comment #12 from Magnus Reftel --- Works fine on trunk (tested version 96c7d4b1727c5f9ddcbb02fb69f727a0f2f3572e).
[Bug c/55383] -Wcast-qual reports incorrect message
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55383 Magnus Reftel changed: What|Removed |Added CC||magnus.reftel at gmail dot com --- Comment #4 from Magnus Reftel --- Also affects 4.6, 4.8 and trunk as of version 96c7d4b1727c5f9ddcbb02fb69f727a0f2f3572e. 4.4 correctly prints just "error: cast discards qualifiers from pointer target type". Did not check with version 4.5. Since 4.4 had it right, does this count as a 4.6/4.7/4.8/4.9 regression?
[Bug c/55383] -Wcast-qual reports incorrect message
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55383 --- Comment #6 from Magnus Reftel --- Sorry, I'm not a GCC developer - just another user aflicted by the bug.
[Bug c/55383] -Wcast-qual reports incorrect message
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55383 --- Comment #9 from Magnus Reftel --- Created attachment 32331 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32331&action=edit Patch from comment #1, updated to apply on trunk
[Bug c/55383] -Wcast-qual reports incorrect message
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55383 --- Comment #10 from Magnus Reftel --- Applied Manuel López-Ibáñez's patch on top of trunk and tested Jeremy's testcase. Without the patch, the error message says that "__attribute__((noreturn))" is being cast away. With the patch, the error message says that "volatile" is being cast away. Running "make check" to see if there were any regressions.
[Bug c/55383] -Wcast-qual reports incorrect message
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55383 --- Comment #11 from Magnus Reftel --- No regressions seen. Sent en email with the patch to gcc-patches as requested ( http://gcc.gnu.org/ml/gcc-patches/2014-03/msg00517.html ).
[Bug c/55383] -Wcast-qual reports incorrect message
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55383 --- Comment #12 from Magnus Reftel --- Any suggestions on how to progress with this one?