Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 764158 - find a way to backport gcc pr95353 into gcc-10
Summary: find a way to backport gcc pr95353 into gcc-10
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL: https://gcc.gnu.org/PR95353
Whiteboard:
Keywords:
Depends on:
Blocks: gcc-10-stable
  Show dependency tree
 
Reported: 2021-01-06 18:24 UTC by tt_1
Modified: 2021-01-07 11:49 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
minimal example (minimal-example1.cpp,604 bytes, text/x-c++src)
2021-01-06 18:27 UTC, tt_1
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tt_1 2021-01-06 18:24:47 UTC
gcc-10.2.0-r5 has a regression which got triggered in the git version of s25rttr: 

[ 40%] Building CXX object libs/s25main/CMakeFiles/s25Main.dir/TerrainRenderer.cpp.o
/tmp/s25client/libs/s25main/GamePlayer.cpp: In member function ‘void GamePlayer::Deserialize(SerializedGameData&)’:
/tmp/s25client/libs/s25main/GamePlayer.cpp:328:22: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
  328 |         toolsSetting = sgd.PopUnsignedChar();
      |         ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/tmp/s25client/libs/s25main/GamePlayer.cpp:328:22: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
/tmp/s25client/libs/s25main/GamePlayer.cpp:328:22: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
/tmp/s25client/libs/s25main/GamePlayer.cpp:328:22: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
[ 40%] Building CXX object libs/s25main/CMakeFiles/s25Main.dir/Timer.cpp.o


this was fixed in trunk https://gcc.gnu.org/cgi-bin/gcc-gitref.cgi?r=r11-1183 but was not backported yet. I'm filling this backport mostly to allow it blocking the gcc-10 stable tracker, but feel free to comment everyone.
Comment 1 tt_1 2021-01-06 18:27:36 UTC
Created attachment 681562 [details]
minimal example

written by Alexander Grund, member of the s25rttr team 

g++-10.2.0 -O3 -Werror -c minimal-example1.cpp
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2021-01-06 19:17:46 UTC
It's a large patch. If it gets backported to gcc-10 branch upstream we will pull it in. Feel free to prod or help at upstream bug report at https://gcc.gnu.org/PR95353.

I would like to avoid gentoo-specific backporting of big nontrivial patches to avoid regressions and mmerge problems for future patches. It should be easy to workaround the failure by avoiding -Werror=stringop-overflow on gcc-10.
Comment 3 tt_1 2021-01-06 21:50:05 UTC
yeah I know that patch is really big, and please not that I never asked for someone to actually pick it up before the backport is merged into gcc-10 by upstream. It is only one of many problems with parts of -O3 optimization it seems, and I'm kind of worried that gcc-10.2.0 will go stable regardless.
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2021-01-06 22:30:36 UTC
I would say that bad diagnostic while tedious to deal with is not a stable blocker.

I don't think this regression is tied to -O3. Upstream bug report specifically has -O2 example on binutils.

Given that -O3 is less tested that default -O2 (for both goo upstream and users' upstreams) it is natural to have more bugs there. The only way to get -O3 better is to test, report and fix bugs in software. But I would also say that -O3-only bugs should not block gcc stabilization either.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-01-07 11:49:43 UTC
A decent compromise would be pinging us when it's in.