Bug 1463739 - GCC 7, aligned_storage and “dereferencing type-punned pointer will break strict-aliasing rules”
Summary: GCC 7, aligned_storage and “dereferencing type-punned pointer will break stri...
Keywords:
Status: CLOSED DUPLICATE of bug 1448666
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 26
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-21 15:35 UTC by Jeff Layton
Modified: 2017-06-21 23:27 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-06-21 23:27:51 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 80593 0 None None None 2017-06-21 15:35:49 UTC

Description Jeff Layton 2017-06-21 15:35:49 UTC
I was trying to build ceph on my f26 host. It has an embedded copy of rocksdb, which g++-7 seems to be unable to build:

[ 11%] Building ASM object src/erasure-code/isa/CMakeFiles/cephd_ec_isa.dir/__/__/isa-l/erasure_code/gf_2vect_dot_prod_avx.asm.o
In file included from /home/jlayton/git/ceph/src/rocksdb/db/write_batch_internal.h:12:0,
                 from /home/jlayton/git/ceph/src/rocksdb/db/column_family.h:20,
                 from /home/jlayton/git/ceph/src/rocksdb/db/version_set.h:31,
                 from /home/jlayton/git/ceph/src/rocksdb/db/compaction.h:11,
                 from /home/jlayton/git/ceph/src/rocksdb/db/compaction_iterator.h:14,
                 from /home/jlayton/git/ceph/src/rocksdb/db/builder.cc:16:
/home/jlayton/git/ceph/src/rocksdb/db/write_thread.h: In member function ‘std::mutex& rocksdb::WriteThread::Writer::StateMutex()’:
/home/jlayton/git/ceph/src/rocksdb/db/write_thread.h:192:78: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
       return *static_cast<std::mutex*>(static_cast<void*>(&state_mutex_bytes));
                                                                              ^
cc1plus: all warnings being treated as errors
make[6]: *** [CMakeFiles/rocksdb.dir/build.make:135: CMakeFiles/rocksdb.dir/db/builder.cc.o] Error 1
make[5]: *** [CMakeFiles/Makefile2:2225: CMakeFiles/rocksdb.dir/all] Error 2
make[4]: *** [CMakeFiles/Makefile2:2237: CMakeFiles/rocksdb.dir/rule] Error 2
make[3]: *** [Makefile:877: rocksdb] Error 2
make[2]: *** [src/CMakeFiles/rocksdb_ext.dir/build.make:113: src/rocksdb_ext-prefix/src/rocksdb_ext-stamp/rocksdb_ext-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:1715: src/CMakeFiles/rocksdb_ext.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....


...some digging around turned up this gcc bug report:

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

...which seems to indicate that this is a regression in gcc7. Can we get the patch merged into gcc for f26 for this?

Comment 1 Jeff Layton 2017-06-21 23:27:51 UTC

*** This bug has been marked as a duplicate of bug 1448666 ***


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