help (or wishlist) with "struct"

2023-06-30 Thread Rafał Pietrak via Gcc

Hi everybody,

I hope this is not inappropriate question for this list, since internet 
provides "some" means to get it done:


https://stackoverflow.com/questions/8259447/give-structure-offset-attribute-to-assembler,

https://forum.microchip.com/s/topic/a5C3l00M24UEAS/t238022?comment=P-1892766,
https://www.avrfreaks.net/s/topic/a5C3l00UGsnEAG/t078691
Still, this problem is not  really well resolved by any of those 
suggestions.


Having the following "C" source:
-
struct driver_s {
struct driver_s *next, *current;
};


IMHO "the most comfortable" assembler source matching the above would 
look like this:

-
.struct 0
driver_next: .struct driver_next+4  ; "4" being the sizeof(void*)
driver_current: .struct driver_current+4 ; same as above

-

Although it could possibly be more "traditional" like this:
-
#define driver_next_offset 4
#define driver_current_offset 8

-

Which is less readable because sizes of fields disappear from assembler 
sources. But functionally, it would do.


So I was wondering, is there (or may be could it be there) a compiler 
option, that would make it spit out the offsets into an assembler source 
(like in form of the above code snippet) much like today "-MM" option 
provides "C" source file dependency list?


I'd like to point out, that within the embedded world, this use case 
(integration of large assembler portions of code with equally large "C" 
sources) is so extensive, that may be it should be supported by a 
compiler option directly?


With kind regards,

-R
PS: pls respond directly to my  address, as I'm not a regular subscriber 
of the list.


GCC 10.5 Release Candidate available from gcc.gnu.org

2023-06-30 Thread Richard Biener via Gcc
The first release candidate for GCC 10.5 is available from

https://gcc.gnu.org/pub/gcc/snapshots/10.5.0-RC-20230630/

and shortly its mirrors.  It has been generated from git commit
r10-11483-g8c12c47d0c5c40.

I have so far bootstrapped and tested the release candidate on
x86_64-linux.

Please test it and report any issues to bugzilla.  Note this
will be the last release from the GCC 10 branch.

If all goes well, we'd like to release 10.5 and close the branch
on Friday, July 7th.


Re: Inquiry about Getting Started with GCC Projects as a Beginner

2023-06-30 Thread Benjamin Priour via Gcc
Hi,

I am a current GSoC student on GCC, so I'll let some of your questions to
more veteran contributors. However, feel free to also reach out to me if
you got any questions as to where to start, as I consider myself just out
of this phase.

Programming Languages: Which programming languages are commonly used in
   GCC projects? Are there any specific languages that you recommend
beginners
   to focus on initially?

GCC is written in a customized mix of C++ and C. Some C++ standard
constructs have been handmade, such as vectors. However, if you are
familiar with C++, I believe you'll adapt quickly to those. If you consider
contributing to some language front-end, or to some specific back-end, then
knowledge on that front will always be useful. However, from my short
experience, I can already tell you that GCC is in itself a great teacher,
as long as you have the basics, or put the extra effort to get them, you'll
step up your game quickly.

Tools: What are the essential tools utilized in GCC projects? It would
   be helpful to know which tools are commonly used for tasks such as
version
   control, project management, documentation, and testing.

Git is the one tool you have to get used for GCC, as for testing it is a
bit old-fashioned with a TCL based testsuite (see Dejagnu). I'd encourage
you to try install GCC from the sources, and poke around them in your
favorite editor. It might be a bit rough at first, but that's also how
you'll progress quickly.
Obviously, if you consider contributing to the development of GCC, you will
need to be debug some things. I think GDB is the most used debugger here.

 Learning Resources: Could you please recommend any online resources,
   tutorials, or documentation that can assist beginners in understanding
GCC
   projects and the associated technologies?

I would recommend https://gcc.gnu.org/contribute.html obviously, but also
https://gcc-newbies-guide.readthedocs.io/en/latest/index.html, that will
soon get extra content. If you decide to take a look at the sources, see
the documentation https://gcc.gnu.org/onlinedocs/gccint/index.html.
I am also writing a blog to keep track of my GSoC project, once I have a
proper open source license set up I will send you the link (in a few hours
if I'm not lazy).

Good luck and feel free to reach out,
Benjamin.


Re: Clarification on newlib version for building AMDGCN offloading backend

2023-06-30 Thread Wileam Yonatan Phan via Gcc
Hi Andrew,

Just wanna follow up on the progress of this endeavor of enabling GCC with 
AMDGCN offloading in Spack. So far I think I've got everything working, except 
for the part where libgomp is pulled from the wrong place at runtime, because 
Spack prefers using RPATH to LD_LIBRARY_PATH. As outlined in the Spack PR 
comments, the proposed fix is modifying the *link_gomp field inside 
/lib/gcc/amdgcn-amdhsa//specs to add the rpath 
flags for libgomp. But I'm honestly unsure if this should be done at configure 
time, build time, or install time.

The Spack PR can be accessed here: 

Please advise,
Wil

From: Andrew Stubbs 
Sent: Thursday, March 30, 2023 04:45
To: Wileam Yonatan Phan ; gcc@gcc.gnu.org 

Subject: Re: Clarification on newlib version for building AMDGCN offloading 
backend 
 
On 29/03/2023 19:18, Wileam Yonatan Phan wrote:
> Hi Andrew,
> 
> I just built GCC 12.2.0 with AMDGCN offloading successfully with Spack!
> However, when I tried to test it with an OpenACC test code that I have, I 
> encountered the following error message:
> 
> wyp@basecamp:~/work/testcodes/f90-acc-ddot$ gfortran -fopenacc 
> -foffload=amdgcn-unknown-amdhsa="-march=gfx900" ddot.f90
> as: unrecognized option '-triple=amdgcn--amdhsa'
> mkoffload: fatal error: x86_64-pc-linux-gnu-accel-amdgcn-unknown-amdhsa-gcc 
> returned 1 exit status
> compilation terminated.
> lto-wrapper: fatal error: 
> /home/wyp/work/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-12.2.0/gcc-12.2.0-w7lclfarefmge3uegn2a5vw37bnwhwto/libexec/gcc/x86_64-pc-linux-gnu/12.2.0//accel/amdgcn-unknown-amdhsa/mkoffload
>  returned 1 exit status
> compilation terminated.
> /usr/bin/ld: error: lto-wrapper failed
> collect2: error: ld returned 1 exit status

My guess is that it's trying to use the wrong assembler. Usually this 
means there is a problem with your installation procedure and/or your 
PATH. I think you should be able to investigate further using -v and/or 
strace. The correct one should be named 
$DESTDIR/usr/local/amdgcn-amdhsa/bin/as, but this will be different if 
you configured GCC with a custom --prefix location. If you have 
relocated the toolchain since installation then the toolchain will 
attempt to locate libraries and tools relative to the gcc binary. If it 
does not find them there then it looks in the "usual places", and those 
usually contain an "as" suitable only for the host system.

If you find an error on the Wiki instructions please let me know and I 
will correct them.

Andrew

gcc-12-20230630 is now available

2023-06-30 Thread GCC Administrator via Gcc
Snapshot gcc-12-20230630 is now available on
  https://gcc.gnu.org/pub/gcc/snapshots/12-20230630/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 12 git branch
with the following options: git://gcc.gnu.org/git/gcc.git branch 
releases/gcc-12 revision d972c592b33ec81be55539d3c524986190ed2d8a

You'll find:

 gcc-12-20230630.tar.xz   Complete GCC

  SHA256=0a3ed586031b583df424509b984a4d6b5c4c3312d2ed3ed0470af3a78458add8
  SHA1=96cc91fc1a751565a9506e578b4d65e3382e5cb7

Diffs from 12-20230623 are available in the diffs/ subdirectory.

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