Open Bug 1682191 Opened 5 years ago Updated 2 years ago

Firefox breaks when using GCC and -O3

Categories

(Firefox Build System :: General, defect, P5)

defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: whissi, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0

Steps to reproduce:

Build firefox with GCC and -O3.

Actual results:

Try running userscript addon which will fail like shown in attached screenshot.

Try using web.whatsapp.org: Login and refresh page, it will stop working when firefox was built using -O3.

Go to https://opinov8.com -- after reload, no images is loaded and JS is garbage/doesn't work.

Expected results:

Everything works when firefox was built using -O2. Using CLANG instead of GCC and -O3 works, too.

I'm not sure about the accurate component for this issue.
I will assign "Firefox Build System: General" maybe it could be a good starting point.
Thanks.

Component: Untriaged → General
Product: Firefox → Firefox Build System

This is likely a GCC bug, which we wouldn't be able to do much about. Honza, what do you think?

Flags: needinfo?(jh)

JFYI: I understand that there is probably not much which can be done from Mozilla's POV. The purpose of this bug is to get some help finding the problematic code to get this reported to GCC upstream. We will post an update to this bug soon, a Gentoo user did some tests in the meanwhile and was able to reproduce this problem with vanilla GCC >=10 (so this is a regression, GCC 9 works and still not fixed in upcoming GCC 11 version).

Loop vectorization, -ftree-loop-vectorize, which will be auto-enabled when using -O3, is the trigger. It's broken in GCC 10+.

Assignee: nobody → sheehan
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Priority: -- → P3

Do you have any idea which function gets misoptimized?

Flags: needinfo?(jh)

After a chat with glandium and Connor, I'm going to unassign this bug.
This problem can only be triggered if GCC flags are manually modified to add -O3. If Firefox defaults are being overridden already, then it is understandable that bugs related to these manually-defined flags will have to be manually worked around.

TL;DR: if someone downstream is running into this, disable the tree-loop-vectorize flag, as discovered by Thomas (thanks Thomas!)

Assignee: sheehan → nobody
Status: ASSIGNED → UNCONFIRMED
Ever confirmed: false
Priority: P3 → P5

While I agree non default build flags aren't exactly a supported configuration, I suspect if auto vectorization was broken as a whole on gcc 10 there'd be much more noise about it. Has anyone ruled out that the auto vectorization is just triggering an indexing bug more reliably via the vectorized load?

Severity: -- → S4

Shouldn't this bit be given a higher priority given that O2 in GCC 12 enables autovectorization?

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: