An odd case with structure field alignment.

2022-09-04 Thread Iain Sandoe
Hi,

I am clearly missing something here … can someone point out where it is?

https://gcc.gnu.org/onlinedocs/gcc-3.3/gcc/Variable-Attributes.html#Variable%20Attributes
in the discussion of applying this to structure fields:

"The aligned attribute can only increase the alignment; but you can decrease it 
by specifying packed as well."

Consider:

struct odd {
  int * __attribute__((aligned(2))) a;
  char c;
};

I would expect, given reading of the information on the aligned attribute, that 
the under-alignment of a would be ignored (since there is no packed attribute 
on either the field or the struct).

However, on x86_64, powerpc64 linux and x86_64, powerpc Darwin, I see that the 
size of the struct is sizeof(pointer) + 2 and the alignment is 2.

OTOH:

struct OK {
  int  __attribute__((aligned(2))) a;
  char c;
};

behaves as expected (the under-alignment is ignored, silently).

as does this…

struct maybe {
  int *a  __attribute__((aligned(2)));
  char c;
};

* the type of the pointer does not seem to be relevant (i.e. AFAICT the 
behaviour is the same for char * etc.)

Is there some special rule about pointers that I have not found ?

[it’s making an ABI mismatch with clang, which treats the int * as expected 
from the documentation quoted above]

cheers
Iain





Re: Wanted: original ConceptGCC downloads / branch, concepts-lite branch

2022-09-04 Thread Aaron Gray via Gcc
Great, thanks alot !

On Wed, 17 Aug 2022 at 21:23, Jonathan Wakely  wrote:
>
>
>
> On Wed, 17 Aug 2022, 16:20 Richard Earnshaw via Gcc,  wrote:
>>
>>
>>
>> On 17/08/2022 12:42, Aaron Gray via Gcc wrote:
>> > Hi,
>> >
>> > I am looking for the original ConceptGCC source code, the
>> > https://www.generic-programming.org/software/ConceptGCC/download.html has
>> > all broken links and the SVN is gone.
>> >
>> > Is this available on GCC git or SVN ?
>> >
>> > Also I am wondering if the original concepts-lite code is available too
>> > anywhere please ?
>> >
>> > Also any pointers to the documentation for the current implementation ?
>> >
>> > Regards,
>> >
>> > Aaron
>>
>> Not withstanding what others have already said, the various concepts
>> branches are still in the git repository, but aren't in the standard
>> pull set.  You can use git fetch to explicitly pull them:
>>
>> d743a72b52bcfaa1effd7fabe542c05a30609614refs/dead/heads/c++-concepts
>>
>>
>
>
> This is "concepts lite".
>
>
>> 780065c813a72664bd46a354a2d26087464c74fc
>> refs/dead/heads/conceptgcc-branch
>>
>>
>
>
> I think this was Doug Gregor's work, but I don't know how much of ConceptGCC 
> is present on the branch.
>
>
>> ce85971fd96e12d0d6675ecbc46c9a1884df766c
>> refs/dead/heads/cxx0x-concepts-branch
>> 14d4dad929a01ff7179350f0251af752c3125d74
>
>
>
> This is described at https://gcc.gnu.org/git.html as:
>
> "This branch contains the beginnings of a re-implementation of Concepts, a 
> likely future feature of C++, using some of the code from the prototype 
> implementation on conceptgcc-branch. It is not currently maintained."
>
> I don't know who did this work, check the git history.



-- 
Aaron Gray

Independent Open Source Software Engineer, Computer Language
Researcher, Information Theorist, and amateur computer scientist.


Re: C++ Concepts: Working Paper n number ?

2022-09-04 Thread Aaron Gray via Gcc
Wonderful, thank you !

On Wed, 17 Aug 2022 at 22:04, Jonathan Wakely  wrote:
>
>
>
> On Wed, 17 Aug 2022, 16:52 Aaron Gray via Gcc,  wrote:
>>
>> Hi, Another query please.
>>
>> I seem to have found the Concepts Technical Specification :-
>>
>> https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3929.pdf
>
>
>
> That's an old draft, see https://en.cppreference.com/w/cpp/experimental for 
> the ISO TS number and the draft numbers.
>
>>
>>
>> But am looking for the n number of the C++ Concepts Working Paper ?
>
>
> Do you mean C++0x Concepts? N2042, and see N2618.
>
>


-- 
Aaron Gray

Independent Open Source Software Engineer, Computer Language
Researcher, Information Theorist, and amateur computer scientist.


gcc-13-20220904 is now available

2022-09-04 Thread GCC Administrator via Gcc
Snapshot gcc-13-20220904 is now available on
  https://gcc.gnu.org/pub/gcc/snapshots/13-20220904/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 13 git branch
with the following options: git://gcc.gnu.org/git/gcc.git branch master 
revision 20d30e737ad79dc36817e59f1676aa8bc0c6b325

You'll find:

 gcc-13-20220904.tar.xz   Complete GCC

  SHA256=f0684bacdde0d53a10b06047823d5f21687db3c47fe2692ef37a9ca8087ca9ef
  SHA1=b22868dd512830949c8c9b6690cc033146fd2482

Diffs from 13-20220828 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-13
link is updated and a message is sent to the gcc list.  Please do not use
a snapshot before it has been announced that way.