Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

275
Views
Different alignment of long doubles in a struct on 64 bit linux with gcc and clang

I noticed that gcc and clang compile the following code differently:

struct { long double ld[1]; } ld1;
struct { long double ld[2]; } ld2;
struct { long double ld[3]; } ld3;

gcc

.comm   ld1,16,16
.comm   ld2,32,32
.comm   ld3,48,32

clang

.type   ld1,@object             # @ld1
.comm   ld1,16,16
.type   ld2,@object             # @ld2
.comm   ld2,32,16
.type   ld3,@object             # @ld3
.comm   ld3,48,16

According to the x86_64 ABI, the alignment should be 16. Why is gcc aligning the latter two structs on 32?

I am using gcc Ubuntu 9.3.0-17ubuntu1~20.04 9.3.0 and clang 10.0.0-4ubuntu1 on Ubuntu 20.04.1 LTS.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!