[Bug c++/111261] New: No warning for out of order class initialisation when using class initialisers

2023-08-31 Thread matt at godbolt dot org via Gcc-bugs
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: matt at godbolt dot org Target Milestone: --- The code: ``` struct S { std::size_t len{s.size()}; std::string s{"A rather long string"}; }; ``` warn

[Bug c++/110197] [13 Regression] Empty constexpr object constructor erronously claims out of range access

2023-08-21 Thread matt at godbolt dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110197 --- Comment #11 from Matt Godbolt --- Thank you Patrick! Great news! About 1/3 of my build's output is this warning right now :)

[Bug c++/110197] [13 Regression] Empty constexpr object constructor erronously claims out of range access

2023-07-27 Thread matt at godbolt dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110197 --- Comment #8 from Matt Godbolt --- Fantastic: thanks everyone!

[Bug c++/110197] New: Empty constexpr object constructor erronously claims out of range access

2023-06-09 Thread matt at godbolt dot org via Gcc-bugs
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: matt at godbolt dot org Target Milestone: --- The following code, compiled on GCC 13.1 complains of a non-constexpr safe array access: ``` #include #include struct

[Bug rtl-optimization/68274] __builtin_unreachable pessimizes code

2023-06-07 Thread matt at godbolt dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68274 --- Comment #5 from Matt Godbolt --- Amazing: thank you Andrew!

[Bug tree-optimization/106020] Spurious warnings about stringop overflows with -march=skylake -O3

2023-05-18 Thread matt at godbolt dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106020 --- Comment #13 from Matt Godbolt --- Thanks Andrew!

[Bug tree-optimization/106020] Spurious warnings about stringop overflows only with LTO

2022-06-18 Thread matt at godbolt dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106020 --- Comment #6 from Matt Godbolt --- I'm afraid to say I've been unable to make a repro case in the short time I had to try - will get back to this but about to go on vacation (!). That's to say dumping the files from CE and using:

[Bug tree-optimization/106020] Spurious warnings about stringop overflows only with LTO

2022-06-18 Thread matt at godbolt dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106020 --- Comment #5 from Matt Godbolt --- Thanks! Understood re: cmake; I wouldn't have picked it but it was the easiest way to repro something on compiler explorer for Howard at the time. I'm sure we can get it down to a smaller cast and a shell

[Bug lto/106020] Spurious warnings about stringop overflows only with LTO

2022-06-17 Thread matt at godbolt dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106020 --- Comment #2 from Matt Godbolt --- There are many hundreds of similar errors in that example; perhaps this example is more of a clue: /opt/compiler-explorer/gcc-12.1.0/include/c++/12.1.0/bits/move.h:205:11: warning: writing 1 byte into a

[Bug lto/106020] Spurious warnings about stringop overflows only with LTO

2022-06-17 Thread matt at godbolt dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106020 --- Comment #1 from Matt Godbolt --- Apologies for the unreduced issue, if I get a chance I'll try and shorten it, but I hoped someone might recognise what the issue is from just this.

[Bug lto/106020] New: Spurious warnings about stringop overflows only with LTO

2022-06-17 Thread matt at godbolt dot org via Gcc-bugs
Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: matt at godbolt dot org CC: marxin at gcc dot gnu.org Target Milestone: --- When using Howard Hinnant's date library, and GCC 12.1 on x86, and then with LTO enabled

[Bug ipa/102067] SEGFAULT in varpool_node::get_constructor during lto1 when optimising or not using debug symbols

2021-08-27 Thread matt at godbolt dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102067 --- Comment #21 from Matt Godbolt --- Thanks, I'd love to upgrade but in this instance I'm stuck on GCC 9.x until the rest of my company can move to it. Nothing annoys me more than having to say that, but ... at least we know what it is and

[Bug c++/102067] SEGFAULT in varpool_node::get_constructor during lto1 when optimising or not using debug symbols

2021-08-26 Thread matt at godbolt dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102067 --- Comment #17 from Matt Godbolt --- This is proprietary code (that the App and Sentry files didn't really contain anything I was concerned about), and it links with a number of other libraries which are much more proprietary (e.g. lwave

[Bug c++/102067] SEGFAULT in varpool_node::get_constructor during lto1 when optimising or not using debug symbols

2021-08-26 Thread matt at godbolt dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102067 --- Comment #15 from Matt Godbolt --- > Can you please try reproducing it locally with the 2 pre-processed file. I'm not sure how to: if I don't have all the object files available in my link line I get missing symbol errors before any lto1

[Bug c++/102067] SEGFAULT in varpool_node::get_constructor during lto1 when optimising or not using debug symbols

2021-08-26 Thread matt at godbolt dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102067 --- Comment #13 from Matt Godbolt --- Both attached. When they're built they're built with: ``` /home/mgodbolt/dev/wave/cmake-build-release/env/bin/x86_64-conda_cos6-linux-gnu-g++ -DSPDLOG_FMT_EXTERNAL -Igenerated -I../src

[Bug c++/102067] SEGFAULT in varpool_node::get_constructor during lto1 when optimising or not using debug symbols

2021-08-26 Thread matt at godbolt dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102067 --- Comment #12 from Matt Godbolt --- Created attachment 51361 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51361=edit preprocessed. gzipped, Sentry.cpp

[Bug c++/102067] SEGFAULT in varpool_node::get_constructor during lto1 when optimising or not using debug symbols

2021-08-26 Thread matt at godbolt dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102067 --- Comment #11 from Matt Godbolt --- Created attachment 51360 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51360=edit preprocessed, gzipped App.cpp

[Bug c++/102067] SEGFAULT in varpool_node::get_constructor during lto1 when optimising or not using debug symbols

2021-08-26 Thread matt at godbolt dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102067 --- Comment #10 from Matt Godbolt --- Thanks! Will attach!

[Bug c++/102067] SEGFAULT in varpool_node::get_constructor during lto1 when optimising or not using debug symbols

2021-08-25 Thread matt at godbolt dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102067 --- Comment #5 from Matt Godbolt --- > And can you please test a more recent compiler (gcc-10 or gcc-11)? Unfortunately not easily; we have a whole ecosystem of libraries we link in (not attached here). If we get any more time we'll try and

[Bug c++/102067] SEGFAULT in varpool_node::get_constructor during lto1 when optimising or not using debug symbols

2021-08-25 Thread matt at godbolt dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102067 --- Comment #4 from Matt Godbolt --- Interestingly, if we extract (with nm x) the files in the library, and glob them in instead of naming the library file, everything works. We're having difficulty constructing a reduced case, as we need a

[Bug c++/102067] SEGFAULT in varpool_node::get_constructor during lto1 when optimising or not using debug symbols

2021-08-25 Thread matt at godbolt dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102067 --- Comment #2 from Matt Godbolt --- Hi Martin! Thanks for the quick reply. We don't have an easy way to do this in our current setup: those files are built and published as a library by a different system. We'll give it a go though.

[Bug c++/102067] New: SEGFAULT in varpool_node::get_constructor during lto1 when optimising or not using debug symbols

2021-08-25 Thread matt at godbolt dot org via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: matt at godbolt dot org Target Milestone: --- Whillinking against a static library containing LTO objects, the `lto1` stage crashes with a segfault

[Bug c++/96868] C++20 designated initializer erroneous warnings

2020-08-31 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96868 --- Comment #2 from Matt Godbolt --- Thanks: I was confused (as I think will many folks be). The examples for designated initialisers in C++20 on cppreference cite this behaviour as being useful^. Of course I understand it can be misused, and

[Bug c++/96868] New: C++20 designated initializer erroneous warnings

2020-08-31 Thread matt at godbolt dot org
: c++ Assignee: unassigned at gcc dot gnu.org Reporter: matt at godbolt dot org Target Milestone: --- The following code, with -Wall -Wextra, GCC 10.x or trunk, -std=c++20: ``` struct MyObj { MyObj(); }; struct Test { int a{}; MyObj obj; }; Test t() { Test t

[Bug c++/96227] New: Comma operation sequencing issue

2020-07-16 Thread matt at godbolt dot org
++ Assignee: unassigned at gcc dot gnu.org Reporter: matt at godbolt dot org Target Milestone: --- Filing on behalf of @lunasorcery (on twitter): The following code: ``` #include struct S { S(char const* message) { puts(message); } }; void operator,(S,S){} int main

[Bug demangler/94797] libiberty doesn't demangle spaceship operator

2020-04-27 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94797 --- Comment #3 from Matt Godbolt --- Thanks so much!

[Bug other/94797] New: libiberty doesn't demangle spaceship operator

2020-04-27 Thread matt at godbolt dot org
: other Assignee: unassigned at gcc dot gnu.org Reporter: matt at godbolt dot org Target Milestone: --- With trunk gcc and latest binutils, `c++filt` does not demangle spaceship operator, leaving `_ZNK3FoossERKS_` mangled. [ see, e.g. https://github.com/mattgodbolt/compiler

[Bug other/88841] New: Missed optimization transforming cascading ||s into a bit select

2019-01-14 Thread matt at godbolt dot org
Priority: P3 Component: other Assignee: unassigned at gcc dot gnu.org Reporter: matt at godbolt dot org Target Milestone: --- It seems around GCC 7 an optimization was added turning multiple comparisons of a small range into a bit-select. This optimization seems

[Bug rtl-optimization/88712] New: Optimization: mov edx, 0 not replaced with xor edx, edx in this case

2019-01-05 Thread matt at godbolt dot org
Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: matt at godbolt dot org Target Milestone: --- The code: ---snip int func(int val, const int *ptr) { int res = val + 1234; if (res == *ptr) { res = 0

[Bug c++/88380] New: Sequence of not-explicitly initialised, initialised, variable length generates no initialiser

2018-12-05 Thread matt at godbolt dot org
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: matt at godbolt dot org Target Milestone: --- In the following code: --- struct S { char uninit; char initialised = 11; char variable[]; }; void

[Bug libstdc++/67632] explicit instantiation omits copy constructor and others

2018-04-04 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67632 Matt Godbolt changed: What|Removed |Added CC||matt at godbolt dot org --- Comment #11

[Bug lto/81004] [7/8 Regression] linking failed with -flto and static libboost_program_options

2018-02-05 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81004 --- Comment #24 from Matt Godbolt --- Thanks so much for looking in to this Jan!

[Bug lto/81004] [7/8 Regression] linking failed with -flto and static libboost_program_options

2018-01-05 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81004 --- Comment #16 from Matt Godbolt --- I see the target milestone is 7.3, but this bug is still marked NEW. Has there been any further thought on this? I realise this is a tough one, but we've had to either disable LTO, or roll back to c++14 on

[Bug target/80837] [7/8 regression] x86 accessing a member of a 16-byte atomic object generates terrible code: splitting/merging the bytes

2017-12-20 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80837 Matt Godbolt changed: What|Removed |Added CC||matt at godbolt dot org --- Comment #7

[Bug c++/82299] -Wuseless-cast errors on typed enums used in member data initializers in c++1z

2017-09-29 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82299 --- Comment #7 from Matt Godbolt --- Perfect! Thanks for clarifying, sorry for the confusion :)

[Bug c++/82299] -Wuseless-cast errors on typed enums used in member data initializers in c++1z

2017-09-29 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82299 --- Comment #5 from Matt Godbolt --- NB the proposed patch above has a test that compiles with -std=c++11 -- this bug only occurs with std=c++1z, not 11. The fix may be right, but I wonder if the test needs to be changed? Unless I've misread

[Bug c++/82299] New: -Wuseless-cast errors on typed enums used in member data initializers in c++1z

2017-09-22 Thread matt at godbolt dot org
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: matt at godbolt dot org Target Milestone: --- The follow code: ``` // compile with -Wuseless-cast -std=c++1z enum Enum : char { A = 0, B = 1 }; struct S { Enum e { Enum

[Bug rtl-optimization/82280] New: Missed optimization opportunity constexpr/inline data copy not elided

2017-09-21 Thread matt at godbolt dot org
Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: matt at godbolt dot org Target Milestone: --- Consider the C++ code: ``` #include #include constexpr auto get_tokens() { return std::array<char, 53>{"

[Bug sanitizer/81021] stack-use-after-scope false positive error with exceptions

2017-08-29 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81021 --- Comment #34 from Matt Godbolt --- Confirmed this fixes all the issues we were seeing. Thanks!

[Bug target/48227] "rep ret" generated for -march=core2

2017-08-09 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48227 --- Comment #5 from Matt Godbolt --- Seems to have been fixed in 4.9

[Bug sanitizer/81021] stack-use-after-scope false positive error with exceptions

2017-07-27 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81021 --- Comment #32 from Matt Godbolt --- Thanks! One thing, I probably misunderstand this, but you've put 7.1 in "known to work" above: is this on purpose? 7.1 is the version the issue comes up in, I assume it'll be fixed in an upcoming 7.2

[Bug lto/81004] [7/8 Regression] linking failed with -flto and static libboost_program_options

2017-06-09 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81004 --- Comment #14 from Matt Godbolt --- I've just hit this same issue too (in only one of several projects I build with 7.1 and LTO). If anyone has any thoughts at a workaround I'd be very appreciative. Thanks!

[Bug sanitizer/81021] stack-use-after-scope false positive error with exceptions

2017-06-08 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81021 --- Comment #2 from Matt Godbolt --- Thanks Martin!

[Bug sanitizer/81021] New: stack-use-after-scope false positive error with exceptions

2017-06-08 Thread matt at godbolt dot org
Priority: P3 Component: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: matt at godbolt dot org CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at gcc dot

[Bug debug/80629] Missing .loc for a function in the presence of -O2

2017-05-04 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80629 --- Comment #1 from Matt Godbolt --- This bug is noticeable in Compiler Explorer: https://godbolt.org/g/scFj7A for example; the function is not colourised as CE uses the .locs to track how the source lines map to asm. One can also see how the

[Bug debug/80629] New: Missing .loc for a function in the presence of -O2

2017-05-04 Thread matt at godbolt dot org
Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: matt at godbolt dot org Target Milestone: --- Firstly; I appreciate how tricky it is to keep track of debug information in the presence of optimization and inlining, but I wonder if there's something specific happening

[Bug c++/80559] Segmentation fault on invalid initialiser list template arguments

2017-05-02 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80559 --- Comment #2 from Matt Godbolt --- Thanks: it seems the command-line parameter `-std=c++1z` is needed to trigger the segfault. https://godbolt.org/g/6oDO6X Apologies for not realising this in the initial report.

[Bug c++/80559] New: Segmentation fault on invalid initialiser list template arguments

2017-04-28 Thread matt at godbolt dot org
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: matt at godbolt dot org Target Milestone: --- Build: GCC v8.0.0 (built from source 20170428) The following code: #include template struct Stack_t {}; template constexpr

[Bug c++/79083] New: GCC incorrectly compiles calls to constexpr static methods via a non-constexpr variable

2017-01-13 Thread matt at godbolt dot org
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: matt at godbolt dot org Target Milestone: --- Consider the following (unusual) code: -- struct Foo { static constexpr bool hasBar() { return true; } }; void test

[Bug c++/70834] Incorrect warning for placement new when conditionally used

2017-01-03 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70834 --- Comment #2 from Matt Godbolt --- if constexpr is of course the right solution here, for certain. I appreciate the compiler determining which if() branch to take in the non-constexpr case is tricky.

[Bug c++/70909] Libiberty Demangler segfaults (4)

2016-11-22 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70909 --- Comment #16 from Matt Godbolt --- Just to be clear; I've been told GCC 6.2 is not required to compile the code I linked; the earliest compiler it has been repro'd with is 4.9 (though we haven't tested further back). It's also the mangled

[Bug c++/70909] Libiberty Demangler segfaults (4)

2016-11-21 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70909 --- Comment #14 from Matt Godbolt --- Created attachment 40101 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40101=edit compile with gcc 6.2 -std=c++14 This reproduces the issue. Compile with g++ 6.2 and -std=c++14 to create a file which

[Bug c++/70909] Libiberty Demangler segfaults (4)

2016-11-21 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70909 --- Comment #13 from Matt Godbolt --- We will try and get a small repro case. It comes from open source software: it's from the compiling_tests.cpp program in trompeloeil (https://github.com/rollbear/trompeloeil/blob/master/compiling_tests.cpp.

[Bug c++/61414] enum class bitfield size-checking failure

2016-10-27 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61414 Matt Godbolt changed: What|Removed |Added CC||matt at godbolt dot org --- Comment #8

[Bug c++/70909] Libiberty Demangler segfaults (4)

2016-10-21 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70909 Matt Godbolt changed: What|Removed |Added CC||matt at godbolt dot org --- Comment #4

[Bug lto/69188] ICE when linking objects at different optimization levels with LTO and profile generation enabled.

2016-06-30 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69188 --- Comment #15 from Matt Godbolt --- I just tried on GCC 6.1; same issue (lto-symtab.c:119 similarly to anthony's snapshot build).

[Bug lto/69188] ICE when linking objects at different optimization levels with LTO and profile generation enabled.

2016-06-30 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69188 --- Comment #14 from Matt Godbolt --- We confirm seeing the same issue (a large proprietary system, when building optimized tests at -O3 but linking against test libraries compiled with -O2).

[Bug c++/70834] New: Incorrect warning for placement new when conditionally used

2016-04-27 Thread matt at godbolt dot org
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: matt at godbolt dot org Target Milestone: --- Consider some code which tries to placement-new into an internal buffer (if the object fits), else uses the heap: -- #include struct Test

[Bug c++/70647] Feature request: warning for self-moving in constructors

2016-04-14 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70647 --- Comment #4 from Matt Godbolt --- Agreed re: cast/FE. I couldn't quite get your example to fail as the "o" parameter is unusued (which would be a good clue! #include // for std::move struct B { int a; int b; B(B &) : a(b),

[Bug c++/70647] Feature request: warning for self-moving in constructors

2016-04-14 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70647 --- Comment #2 from Matt Godbolt --- Thanks Manuel. Interestingly this does elicit a warning: struct B { int a; int b; B(B &) : a(static_cast(a)), b(std::move(o.b)) {} }; but this does not: struct B { int a; int b; B(B

[Bug c++/70647] New: Feature request: warning for self-moving in constructors

2016-04-13 Thread matt at godbolt dot org
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: matt at godbolt dot org Target Milestone: --- Consider the following code: #include // for std::move struct A { int a; int b; A(A &) : a(a), // I get a warning here...

[Bug tree-optimization/68274] __builtin_unreachable pessimizes code

2015-11-10 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68274 --- Comment #2 from Matt Godbolt --- Thanks for updating the bug. As a corollary, moving the unreachability above the returns yields the same code as the non-unreachable: https://goo.gl/MdULOs -- int test_with_unreach_First(Side side, const Foo

[Bug c/68274] New: __builtin_unreachable pessimizes code

2015-11-10 Thread matt at godbolt dot org
Assignee: unassigned at gcc dot gnu.org Reporter: matt at godbolt dot org Target Milestone: --- While experimenting with __builtin_unreachable I found that in some cases adding it pessimizes the code. Consider the following code (also at https://goo.gl/WmR8PX): -- enum Side { Bid

[Bug ipa/68148] Devirtualization only applies to last of multiple successive calls

2015-10-30 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68148 --- Comment #2 from Matt Godbolt --- That would make sense for my second observation; but if it's a per-call thing why is only one of the calls speculatively devirtualized?

[Bug c++/68148] New: Devirtualization only applies to last of multiple successive calls

2015-10-29 Thread matt at godbolt dot org
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: matt at godbolt dot org Target Milestone: --- Given the code: struct Interface { virtual ~Interface() {} virtual void virtualFunc() = 0; virtual void virtualFunc2() = 0

[Bug middle-end/67809] Empty pointer-chasing loops aren't optimized out

2015-10-01 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67809 Matt Godbolt changed: What|Removed |Added CC||matt at godbolt dot org --- Comment #1

[Bug middle-end/67809] New: Empty pointer-chasing loops aren't optimized out

2015-10-01 Thread matt at godbolt dot org
: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: matt at godbolt dot org Target Milestone: --- The following code: ``` struct Foo { Foo *next; void release() { Foo *tmp = 0; for (Foo *it = next; it; it = tmp) { tmp = it->n

[Bug other/66259] Combined gcc and binutils build from git-master fails, with gas/as-new not existing

2015-07-16 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66259 Matt Godbolt matt at godbolt dot org changed: What|Removed |Added CC||matt at godbolt

[Bug other/66259] Combined gcc and binutils build from git-master fails, with gas/as-new not existing

2015-07-16 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66259 --- Comment #7 from Matt Godbolt matt at godbolt dot org --- I just tried with binutils 2.24 instead of 2.25, and the issue did not manifest itself.

[Bug lto/53730] exception handling broken - lto and static standard libs

2015-04-23 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53730 Matt Godbolt matt at godbolt dot org changed: What|Removed |Added CC||matt at godbolt

[Bug c/64396] New: Missed optimization in post-loop register handling

2014-12-23 Thread matt at godbolt dot org
: c Assignee: unassigned at gcc dot gnu.org Reporter: matt at godbolt dot org I noticed a missed opportunity in GCC that Clang and ICC seem to take advantage of. All versions of GCC I tested (up to 4.9.0) seem to have the same trouble. The following source (for x86_64) shows up

[Bug preprocessor/60723] Line directives with incorrect system header flag

2014-06-10 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60723 --- Comment #8 from Matt Godbolt matt at godbolt dot org --- Thanks Nicholas :)

[Bug c++/61412] New: Warnings incorrectly suppressed when compiling previously preprocessed file

2014-06-04 Thread matt at godbolt dot org
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: matt at godbolt dot org Some warnings appear to be lost when compiling a previously-preprocessed source file (e.g. as a result of using ccache, which caches the intermediate

[Bug c++/61412] Warnings incorrectly suppressed when compiling previously preprocessed file

2014-06-04 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61412 --- Comment #3 from Matt Godbolt matt at godbolt dot org --- Many apologies: this does indeed also happen with GCC 4.7.2! Thanks for checking. Also, re: the -Wsystem-headers, this does indeed fix this case but of course in general isn't a good

[Bug c++/61412] Warnings incorrectly suppressed when compiling previously preprocessed file

2014-06-04 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61412 --- Comment #5 from Matt Godbolt matt at godbolt dot org --- I produced the file by preprocessing an existing file with g++ -E on an existing file that exhibited the file (250k+ lines). The full line I used to create the original preprocessed

[Bug c++/61412] Warnings incorrectly suppressed when compiling previously preprocessed file

2014-06-04 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61412 --- Comment #12 from Matt Godbolt matt at godbolt dot org --- I appreciate your patience on this! I'm also now confused. My 250k+ preprocessed file does not warn on a reordered constructor initializer, despite there being no system code

[Bug c++/61412] Warnings incorrectly suppressed when compiling previously preprocessed file

2014-06-04 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61412 Matt Godbolt matt at godbolt dot org changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED

[Bug preprocessor/60723] Line directives with incorrect system header flag

2014-06-04 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60723 Matt Godbolt matt at godbolt dot org changed: What|Removed |Added CC||matt at godbolt

[Bug c++/60955] New: Erroneous warning about taking address of register with std=c++1y

2014-04-24 Thread matt at godbolt dot org
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: matt at godbolt dot org This short snippet, when compiled with GCC4.9.0 and -Wextra and -std=c++1y, gives an erroneous warning about taking the address of a register: === $ cat test2.cc

[Bug c++/60955] Erroneous warning about taking address of register with std=c++1y

2014-04-24 Thread matt at godbolt dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60955 --- Comment #1 from Matt Godbolt matt at godbolt dot org --- The previous snippet wasn't quite as minimal as it could be. This single line also reproduces it: unsigned int erroneous_warning(register int a) { return (a); } Jonathan Wakely

[Bug c++/52026] [c++0x] Constexpr Variable Appears Uninitialized in Lambda

2013-01-29 Thread matt at godbolt dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52026 Matt Godbolt matt at godbolt dot org changed: What|Removed |Added CC||matt

[Bug c++/55553] New: Segmentation fault when calling vector::push_back with an initialized list

2012-11-30 Thread matt at godbolt dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3 Bug #: 3 Summary: Segmentation fault when calling vector::push_back with an initialized list Classification: Unclassified Product: gcc Version: 4.8.0

[Bug c++/55532] Runtime segfault calling mutable lambda wrapped in a non-mutable lambda within a template function

2012-11-29 Thread matt at godbolt dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55532 --- Comment #1 from Matt Godbolt matt at godbolt dot org 2012-11-29 20:03:47 UTC --- I can reproduce this on GCC 4.8 (rev 185382], and g++ 4.6.3. Adding -O makes the issue go away (as the whole program is optimized to return 0;). From

[Bug lto/54206] build in source dir breaks lto plugin detection

2012-10-04 Thread matt at godbolt dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54206 Matt Godbolt matt at godbolt dot org changed: What|Removed |Added CC||matt

[Bug c++/54801] New: [c++11] static variables constructed with lambda params inside member functions cause undefined errors

2012-10-03 Thread matt at godbolt dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54801 Bug #: 54801 Summary: [c++11] static variables constructed with lambda params inside member functions cause undefined errors Classification: Unclassified Product: gcc

[Bug c++/52759] [4.7/4.8 Regression] ICE in cp/mangle.c

2012-04-03 Thread matt at godbolt dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52759 Matt Godbolt matt at godbolt dot org changed: What|Removed |Added CC||matt at godbolt dot

[Bug c++/52837] ICE in cp/mangle.c:3306

2012-04-03 Thread matt at godbolt dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52837 Matt Godbolt matt at godbolt dot org changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED

[Bug c++/52837] New: ICE in cp/mangle.c:3306

2012-04-02 Thread matt at godbolt dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52837 Bug #: 52837 Summary: ICE in cp/mangle.c:3306 Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3

[Bug c++/52837] ICE in cp/mangle.c:3306

2012-04-02 Thread matt at godbolt dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52837 --- Comment #1 from Matt Godbolt matt at godbolt dot org 2012-04-02 22:17:15 UTC --- Created attachment 27071 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=27071 This is the .ii file that reproduces the problem. (gzipped to get past upload

[Bug c++/52837] ICE in cp/mangle.c:3306

2012-04-02 Thread matt at godbolt dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52837 --- Comment #2 from Matt Godbolt matt at godbolt dot org 2012-04-02 22:51:14 UTC --- After a little more research, I've managed to get a 4-line reproduction case. (See attached). I also confirmed this code compiles without error on GCC4.5

[Bug c++/52837] ICE in cp/mangle.c:3306

2012-04-02 Thread matt at godbolt dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52837 --- Comment #3 from Matt Godbolt matt at godbolt dot org 2012-04-02 22:52:26 UTC --- Created attachment 27072 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=27072 Minimal reproducible test case $ /site/apps/gcc-4.7.0-drw.2/bin/gcc -c gcc-4.7