public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/96717] New: -flifetime-dse=2 breaks webkit-gtk-2.28.4
@ 2020-08-19 22:25 slyfox at gcc dot gnu.org
  2020-08-20  8:10 ` [Bug c++/96717] " redi at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: slyfox at gcc dot gnu.org @ 2020-08-19 22:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96717

            Bug ID: 96717
           Summary: -flifetime-dse=2 breaks webkit-gtk-2.28.4
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: slyfox at gcc dot gnu.org
  Target Milestone: ---

Created attachment 49084
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49084&action=edit
part-of-webkit-gtk-2.28.4.tar.gz

Initially I noticed the bug on liferea which uses webkit-gtk-2.28.4 as a
rendering engine.

I was not able to extract minimal example because I got lost in SFINATE
instance selections. I am not sure if it's a webkit bug or gcc bug.

I'm leaning to gcc bug. gcc-10 used to work. gcc-11 generates code that hits
'ud2'.

The webkit client code looks simple: we create a hash set of raw pointers and
add pointers there to see how hashset resizes:

"""
#define USE_SYSTEM_MALLOC 1 /* avoid bmalloc */

#include "wtf/HashSet.h"
#include "wtf/Threading.h"

using namespace WTF;

int main() {
    HashSet<Thread*> hst;
    for (int i = 1; i < 1000; ++i) {
        Thread * v = (Thread*)(long)(i * 128);
        hst.add(v);
    }
}
"""

But headers take almost 2 megabytes.

Building the example with -fno-lifetime-dse produces working code. Building
without breaks on first hash table resize:

$ ./mk.bash

./a
./mk.bash: line 50: 1054935 Illegal instruction     (core dumped) ./a
132

./a-nodse
0

The 'ud2' is encountered in HashTable::rehash() method:
https://github.com/WebKit/webkit/blob/master/Source/WTF/wtf/HashTable.h#L1304

Attaching self-contained directory with sources and headers.

Can you help me rule out gcc's misbehaviour?

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-02-15 11:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-19 22:25 [Bug c++/96717] New: -flifetime-dse=2 breaks webkit-gtk-2.28.4 slyfox at gcc dot gnu.org
2020-08-20  8:10 ` [Bug c++/96717] " redi at gcc dot gnu.org
2020-08-20  8:14 ` redi at gcc dot gnu.org
2020-08-20  9:19 ` jakub at gcc dot gnu.org
2020-08-20  9:31 ` jakub at gcc dot gnu.org
2022-02-15 10:41 ` redi at gcc dot gnu.org
2022-02-15 10:47 ` redi at gcc dot gnu.org
2022-02-15 10:50 ` pinskia at gcc dot gnu.org
2022-02-15 11:01 ` jakub at gcc dot gnu.org
2022-02-15 11:46 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).