gcc6

Why does GCC 6 assume data is 16-byte aligned?

旧巷老猫 提交于 2021-02-07 12:16:30
问题 (Sorry in advance for not having managed to reduce my problem to a simple failing test case...) I have faced issues with upgrading to GCC 6.3.0 to build our codebase (relevant flags: -O3 -m32 ). Specifically, my application segfaults within a struct ctor call because of GCC optimizations. In this ctor, GCC used movaps : movaps %xmm0,0x30a0(%ebx) movaps requires the operand to be 16-byte aligned . But at this point in time, %ebx points to my object, which is not necessarily 16-byte aligned .

Why does GCC 6 assume data is 16-byte aligned?

有些话、适合烂在心里 提交于 2021-02-07 12:15:19
问题 (Sorry in advance for not having managed to reduce my problem to a simple failing test case...) I have faced issues with upgrading to GCC 6.3.0 to build our codebase (relevant flags: -O3 -m32 ). Specifically, my application segfaults within a struct ctor call because of GCC optimizations. In this ctor, GCC used movaps : movaps %xmm0,0x30a0(%ebx) movaps requires the operand to be 16-byte aligned . But at this point in time, %ebx points to my object, which is not necessarily 16-byte aligned .

gcc 6.1.0 segmentation fault - gcc bug?

不羁岁月 提交于 2020-01-05 04:58:35
问题 Let's consider follwing code. In fact this is narrowed problem I found using gmock and mocking void(void) method. class Base { public: virtual ~Base() {} }; class Derived : public Base { public: void GetValueAndDelete() { delete this; } //here we crash }; int main() { Derived* p = 0; p->GetValueAndDelete(); } Building it with: /tools/gcc6.1/bin/g++ --version g++ (GCC) 6.1.0 with optimization level different than -O0 and running the result causes segmentation fault. Is it gcc bug or something

gcc 6.2.0 is attempting to create shared object when it shouldn't?

不羁岁月 提交于 2019-12-24 04:08:49
问题 With non relocatable assembler code linking was never a problem up until gcc 6.2.0. I don't know the exact version that stared this, but with gcc 5.4.0 (and below) this worked: $ gcc -o httpget ../obj/httpget.o ../../../lib/libribs2_ssl.a -lssl -lcrypto However, with gcc 6.2.0: $ gcc -o httpget ../obj/httpget.o ../../../lib/libribs2_ssl.a -lssl -lcrypto /usr/bin/ld: ../../../lib/libribs2_ssl.a(context_asm.o): relocation R_X86_64_32S against symbol `current_ctx' can not be used when making a

How to tell gcc to disable padding inside struct? [duplicate]

我们两清 提交于 2019-12-19 19:49:34
问题 This question already has answers here : memory alignment within gcc structs (6 answers) Closed 3 years ago . I’m unsure on whether it’s normal or it’s a compiler bug but I have a C struct with lot of members. Among of them, there’s, : struct list { ... ... const unsigned char nop=0x90; // 27 bytes since the begining of the structure const unsigned char jump=0xeb; // 28 bytes since the begining of the structure const unsigned char hlt=0xf4; // 29 bytes since the begining of the structure

Why does GCC not seem to have the filesystem standard library?

▼魔方 西西 提交于 2019-12-12 08:29:02
问题 i'm facing a problem with filesystem library, it should be included in c++17 compiler, after 2 days i tried to install gcc-7.0.2 in raspberry pi but it didn't work, it couldn't recognize the command gcc-7 or g++-7 or even -std=c++17 so i had to install g++-6 and gcc-6 using apt-get install anyway, after installing the 6 version the compiler include c++17. i'm using codeblocks as IDE, i had to add a new compiler and add the option -std=c++17 to enable it,but in the main code when i include the

Using CUDA 8.0 with GCC 6.x - bad function overloading complaint

折月煮酒 提交于 2019-12-10 20:45:34
问题 I'm trying to build some CUDA code using GCC 6.2.1, the default compiler of my distribution (Note: not a GCC version officially supported by CUDA, so you can call this experimental). This is code which builds fine with GCC 4.9.3 and both CUDA versions 7.5 and 8.0. Well, if I build the following (close-to) minimal example: #include <tuple> int main() { return 0; } with the command-line nvcc -std=c++11 -Wno-deprecated-gpu-targets -o main main.cu I get the following errors: /usr/local/cuda/bin/.

Is there, or will there be, a “global” version of the target_clones attribute?

末鹿安然 提交于 2019-12-07 02:57:39
问题 I've recently played around with the target_clones attribute available from gcc 6.1 and onward. It's quite nifty, but, for now, it requires a somewhat clumsy approach; every function that one wants multi-versioned has to have an attribute declared manually. This is less than optimal because: It puts compiler-specific stuff in the code. It requires the developer to identify which functions should receive this treatment. Let's take the example where I want to compile some code that will take

Is there, or will there be, a “global” version of the target_clones attribute?

依然范特西╮ 提交于 2019-12-05 08:04:25
I've recently played around with the target_clones attribute available from gcc 6.1 and onward. It's quite nifty, but, for now, it requires a somewhat clumsy approach; every function that one wants multi-versioned has to have an attribute declared manually. This is less than optimal because: It puts compiler-specific stuff in the code. It requires the developer to identify which functions should receive this treatment. Let's take the example where I want to compile some code that will take advantage of AVX2 instructions, where available. -fopt-info-vect will tell me which functions were