Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7040441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:55:07+00:00 2026-05-28T01:55:07+00:00

In gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00) in

  • 0

In “gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)” in tr1 array, I see this:

  value_type _M_instance[_Nm ? _Nm : 1] __attribute__((__aligned__)); 

whereas in “gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)”, I see this:

  value_type _M_instance[_Nm ? _Nm : 1];

that is, it seems that tr1 arrays are no longer specified as aligned (which affects SSE code written for them). Some of our unit tests are failing in _mm_load_ps. Is there discussion of this change anywhere?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:55:08+00:00Added an answer on May 28, 2026 at 1:55 am

    The specification doesn’t specify that tr1::array is 16-byte aligned. The only guarantee is that the array will be aligned properly according to the size of value_type. Unless the sizes of objects that you are storing in the arrays are such that value_type alignment is a multiple of 16 bytes, then you will not get the 128-bit alignment that you desire to use SSE instructions. If you have existing code that relies upon the fact that one compiler used 16-byte alignment for all array instances, then you should fix it. You’re taking advantage of behavior that is in excess of what the standard defines, which is very fragile.

    If you have code that relies upon a specific amount of alignment on the memory that it uses, then you should explicitly enforce that alignment when you allocate the memory; anything less is prone to errors if you change compilers or platforms. A previous question addresses how to make tr1::array objects use aligned memory.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Mac OS X Lion v10.7.2 Xcode v4.2.1 Build 4D502 gcc version 4.2.1 (Based on
I am running g++(gcc version 3.4.4) on cygwin. I can't get this small snippet
When I'm trying to compile this code with gcc version 4.6.3 on linux with
I am using xcode 4, Compiler version LLVM GCC 4.2. I have been trying
This example seems to compile with VC10 and gcc (though my version of gcc
Redhat 5.5 gcc version 4.1.2 I have a directory call lib, and in that
I have written two short tests and compiled both with g++ -S (gcc version
When I compile C code in recent version of gcc, I am getting the
when I get a compiler error (in my case gcc) in Emacs (version 23
I'm now modifying the gcc's md file, for a mips(el) target. gcc src's version

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.