Re: stabs support in binutils, gcc, and gdb

2013-01-05 Thread David Edelsohn
On Sat, Jan 5, 2013 at 2:53 AM, Joel Brobecker  wrote:
>> > Can you please clarify what "GNU ld is not completely usable" means?
>> > Is that referring to DWARF support? to compatibility with specific AIX
>> > releases? to compatibility with AIX DWARF feature?
>>
>> Sorry, I meant what "GNU ld is now completely usable" means because I
>> believe that it actually is NOT completely usable on AIX.
>
> AdaCore has successfully switched to GNU ld on AIX, tested on AIX
> version 5.x and 7.x. We use a version derived from an old HEAD,
> I believe, but the latest release might have all the necessary
> changes. I cannot tell you that it's perfect, and some options
> provided by the native linker might not be implemented (particularly
> the options relating to TOCs). But we released GNAT Pro 7.0.1/7.0.2
> using GNU ld early last year, and I don't remember seeing any real
> problem being reported.
>
> We had to do some changes, and make some fixes, mostly done by
> Tristan, and normally they should have been contributed to the
> FSF tree. Overall, I think we're pretty happy with GNU ld as
> of now.

It does not look like the changes were merged into the FSF tree.  This
also does not support some of the more recent AIX features added to
GCC.

I also infer that Adacore continues to use the AIX assembler, not GNU as.

Thanks, David


Re: stabs support in binutils, gcc, and gdb

2013-01-05 Thread Joel Brobecker
> It does not look like the changes were merged into the FSF tree.  This
> also does not support some of the more recent AIX features added to
> GCC.

Tristan is usually pretty good at sending these sorts of patches.
I will ask him on Monday if some might be missing. He's been
extremely busy lately, so it's a possibility. It would also be
useful to explain how you are basing your evaluation, and in
particular say what does not work for you.

> I also infer that Adacore continues to use the AIX assembler, not GNU as.

We also use GNU as.

-- 
Joel


gcc-4.7-20130105 is now available

2013-01-05 Thread gccadmin
Snapshot gcc-4.7-20130105 is now available on
  ftp://gcc.gnu.org/pub/gcc/snapshots/4.7-20130105/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 4.7 SVN branch
with the following options: svn://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch 
revision 194933

You'll find:

 gcc-4.7-20130105.tar.bz2 Complete GCC

  MD5=73c907fdcfaea8a91752f79fa53e730c
  SHA1=45bb323258764402aca2d326d99638055fff0d01

Diffs from 4.7-20121229 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-4.7
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.


Re: stabs support in binutils, gcc, and gdb

2013-01-05 Thread David Edelsohn
On Sat, Jan 5, 2013 at 9:52 AM, Joel Brobecker  wrote:
>> It does not look like the changes were merged into the FSF tree.  This
>> also does not support some of the more recent AIX features added to
>> GCC.
>
> Tristan is usually pretty good at sending these sorts of patches.
> I will ask him on Monday if some might be missing. He's been
> extremely busy lately, so it's a possibility. It would also be
> useful to explain how you are basing your evaluation, and in
> particular say what does not work for you.

I and others have not been able to use GNU as and GNU ld to bootstrap
GCC. The resulting object files and shared objects mostly worked in
small experiments, but failed for larger projects, like GCC.

Also, GNU as and GNU ld do not contain support for the new
cmodel=large and thread local storage support added to GCC.

- David


Align a POD srtuct on the stack (aliasing issue with gcc 4.6+)‏

2013-01-05 Thread pps .
Question: How can I allocate random amount of stack space (using char 
arrays or alloca, and then align pointer to that stack space and 
reinterpret this chunk of memory as some structure that has some well 
defined layout that guarantees alignment of certain variables as long 
as the structure itself is aligned properly? How can I do so with 4.6+ 
GCC with full optimizations enabled with strict aliasing enabled (e.g. 
without passing -fno-strict-aliasing).

Pseudo code:

struct my_array
{
   char data[];
};

void * buffer = alloca(sizeof(my_array) + 32);
void * buffer32 = (((uintptr_t)buffer) + 31) & (~31);
assert( ((uintptr_t)buffer) % 32 == 0);

my_array * data = (my_array*)buffer32;

 now use my_array, data->data is 32-byte aligned


I have a huge function that allocates multiple aligned arrays on the stack 
using this approach and now it doesn't produce correct results with GCC 
4.6+ (on arm, I didn't test it on x86).
I've spent 2 days trying to fix the issue, perhaps gcc mailing list is a 
good place to ask for appropriate workaround? I want to ensure that the 
function produces correct result even with strict-aliasing enabled.


Thanks.   

RE: Align a POD srtuct on the stack (aliasing issue with gcc 4.6+)‏

2013-01-05 Thread pps .
>
> Question: How can I allocate random amount of stack space (using char
> arrays or alloca, and then align pointer to that stack space and
> reinterpret this chunk of memory as some structure that has some well
> defined layout that guarantees alignment of certain variables as long
> as the structure itself is aligned properly? How can I do so with 4.6+
> GCC with full optimizations enabled with strict aliasing enabled (e.g.
> without passing -fno-strict-aliasing).
>
> Pseudo code:
>
> struct my_array
> {
>char data[];
> };
>
> void * buffer = alloca(sizeof(my_array) + 32);
> void * buffer32 = (((uintptr_t)buffer) + 31) & (~31);
> assert( ((uintptr_t)buffer) % 32 == 0);
>
> my_array * data = (my_array*)buffer32;
>
>  now use my_array, data->data is 32-byte aligned
>
>
> I have a huge function that allocates multiple aligned arrays on the stack
> using this approach and now it doesn't produce correct results with GCC
> 4.6+ (on arm, I didn't test it on x86).
> I've spent 2 days trying to fix the issue, perhaps gcc mailing list is a
> good place to ask for appropriate workaround? I want to ensure that the
> function produces correct result even with strict-aliasing enabled.
>



I also asked this question on SO, there are more details about the issue:
http://stackoverflow.com/questions/14170010/strict-aliasing-and-memory-alignment
  

Re: stabs support in binutils, gcc, and gdb

2013-01-05 Thread Joel Brobecker
> I and others have not been able to use GNU as and GNU ld to bootstrap
> GCC. The resulting object files and shared objects mostly worked in
> small experiments, but failed for larger projects, like GCC.
> 
> Also, GNU as and GNU ld do not contain support for the new
> cmodel=large and thread local storage support added to GCC.

Perfect, this gives me a better idea of what to ask for on Monday.
I will see what the current status is. We do boostrap GCC, but
I don't think we've tried with the current HEAD, only GCC 4.7.

-- 
Joel