Bug 1376058 - Incorrect results compiling with -O2 on aarch64
Summary: Incorrect results compiling with -O2 on aarch64
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 26
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-14 14:37 UTC by Tom Hughes
Modified: 2018-05-29 11:43 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-05-29 11:43:17 UTC
Type: Bug


Attachments (Terms of Use)
Preprocessed source code (876.38 KB, application/x-gzip)
2016-09-14 14:37 UTC, Tom Hughes
no flags Details

Description Tom Hughes 2016-09-14 14:37:19 UTC
Created attachment 1200837 [details]
Preprocessed source code

Description of problem:

Some code that compiles and runs correctly with the default Fedora options in x86, x86_64 and armv7 produces incorrect results on aarch64. Reducing optimisation from -02 to 01 corrects the output

Version-Release number of selected component (if applicable):

gcc-6.2.1-1.fc26.aarch64

Steps to Reproduce:

I've managed to cut the problem code down to this example (preprocessed code is attached):

#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/linestring.hpp>
#include <boost/geometry/algorithms/is_simple.hpp>

using point = boost::geometry::model::point<double, 2, boost::geometry::cs::cartesian>;
using linestring = boost::geometry::model::linestring<point>;

int main(int argc, char **argv)
{
  linestring geom;

  boost::geometry::append(geom, point(18883003.4675699,-5400734.67051741));
  boost::geometry::append(geom, point(18980842.863775,-5312679.21393289));
  boost::geometry::append(geom, point(19049330.4411185,-5234407.69696887));
  boost::geometry::append(geom, point(18883003.4675699,-5400734.67051741));

  assert(boost::geometry::is_simple(geom));
}

The assertion should not fire, but it does when compiled with -O2 on aarch64. A binary search of the options enabled when going from -O1 to -02 suggests that -fexpensive-optimizations is triggering the problem.

Compiling with -fsanitize=undefined does not report any undefined behaviour.

Comment 1 Fedora End Of Life 2017-02-28 10:18:20 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 2 Fedora End Of Life 2018-05-03 08:29:16 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 3 Fedora End Of Life 2018-05-29 11:43:17 UTC
Fedora 26 changed to end-of-life (EOL) status on 2018-05-29. Fedora 26
is no longer maintained, which means that it will not receive any
further security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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