Re: Adding log files to gcc dump and adding testcase-rtl

2022-05-25 Thread David Malcolm via Gcc
On Wed, 2022-05-25 at 10:25 +0530, RICHU NORMAN wrote:
> Hi,
> I am a beginner in gcc. I am trying to add an instruction to riscv-
> gcc.It
> would be helpful could help with a few tips .

Hi Richu - welcome to GCC development.

FWIW I've written a guide for new GCC contributors which you might find
helpful:
  https://gcc-newbies-guide.readthedocs.io/en/latest/index.html

Caveat: I'm much more familiar with the frontends/diagnostics, rather
than the backends/RTL, so there may be a "frontend" bias in that guide.
 
> 1.How to write comments to rtl or create a custom log file to log
> comments
> to rtl dump?
> 2.How to run testsuite ?
> 3.Is there a way to directly run an rtl test case? Like giving rtl
> input
> and checking the generated asm.(Like in the attachment which is
> posted in
> bugzilla[ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82815 ])
> Please suggest a way to run the gcc-testsuite with these cases. Pfa

I wrote some notes on dealing with the testsuite, and on running
individual cases here:
https://gcc-newbies-guide.readthedocs.io/en/latest/working-with-the-testsuite.html

Hope this is helpful; good luck
Dave



Re: Adding log files to gcc dump and adding testcase-rtl

2022-05-25 Thread David Malcolm via Gcc
On Wed, 2022-05-25 at 06:44 -0400, David Malcolm wrote:
> On Wed, 2022-05-25 at 10:25 +0530, RICHU NORMAN wrote:
> > Hi,
> > I am a beginner in gcc. I am trying to add an instruction to riscv-
> > gcc.It
> > would be helpful could help with a few tips .
> 
> Hi Richu - welcome to GCC development.
> 
> FWIW I've written a guide for new GCC contributors which you might find
> helpful:
>   https://gcc-newbies-guide.readthedocs.io/en/latest/index.html
> 
> Caveat: I'm much more familiar with the frontends/diagnostics, rather
> than the backends/RTL, so there may be a "frontend" bias in that guide.
>  
> > 1.How to write comments to rtl or create a custom log file to log
> > comments
> > to rtl dump?
> > 2.How to run testsuite ?
> > 3.Is there a way to directly run an rtl test case? Like giving rtl
> > input
> > and checking the generated asm.(Like in the attachment which is
> > posted in
> > bugzilla[ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82815 ])
> > Please suggest a way to run the gcc-testsuite with these cases. Pfa
> 
> I wrote some notes on dealing with the testsuite, and on running
> individual cases here:
> https://gcc-newbies-guide.readthedocs.io/en/latest/working-with-the-testsuite.html

Looks like that bug relates to a bug in the __RTL reading code (which I
wrote; sorry!).  There are some notes on running cc1 under the debugger
in my guide here:
  https://gcc-newbies-guide.readthedocs.io/en/latest/debugging.html
which should let you put a breakpoint on the relevant code and step
through it.

Some note on __RTL testcases: you will generally want to have a
"startswith" clause on the __RTL to indicate which compilation pass the
RTL was saved at, since RTL goes through several stages in the backend.

"git grep __RTL" should show some examples of existing __RTL-based
testcases.

See also:
  https://gcc.gnu.org/onlinedocs/gccint/RTL-Tests.html

Dave



Re: Adding log files to gcc dump and adding testcase-rtl

2022-05-25 Thread RICHU NORMAN
This is great, thank you so much!
I am also looking for support regarding adding instructions for the target
machine.



On Wed, May 25, 2022 at 4:14 PM David Malcolm  wrote:

> On Wed, 2022-05-25 at 10:25 +0530, RICHU NORMAN wrote:
> > Hi,
> > I am a beginner in gcc. I am trying to add an instruction to riscv-
> > gcc.It
> > would be helpful could help with a few tips .
>
> Hi Richu - welcome to GCC development.
>
> FWIW I've written a guide for new GCC contributors which you might find
> helpful:
>   https://gcc-newbies-guide.readthedocs.io/en/latest/index.html
>
> Caveat: I'm much more familiar with the frontends/diagnostics, rather
> than the backends/RTL, so there may be a "frontend" bias in that guide.
>
> > 1.How to write comments to rtl or create a custom log file to log
> > comments
> > to rtl dump?
> > 2.How to run testsuite ?
> > 3.Is there a way to directly run an rtl test case? Like giving rtl
> > input
> > and checking the generated asm.(Like in the attachment which is
> > posted in
> > bugzilla[ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82815 ])
> > Please suggest a way to run the gcc-testsuite with these cases. Pfa
>
> I wrote some notes on dealing with the testsuite, and on running
> individual cases here:
>
> https://gcc-newbies-guide.readthedocs.io/en/latest/working-with-the-testsuite.html
>
> Hope this is helpful; good luck
> Dave
>
>

-- 
Richu Norman
Research Scholar
Department of Computer Science
Cochin University of Science and Technology
Ph : (+91)-8848455627


Re: Adding log files to gcc dump and adding testcase-rtl

2022-05-25 Thread David Malcolm via Gcc
On Wed, 2022-05-25 at 16:32 +0530, RICHU NORMAN wrote:
> This is great, thank you so much!

You're welcome.

> I am also looking for support regarding adding instructions for the
> target
> machine.

That's something I've not done (my expertise is mostly in the frontends
and diagnostics).

With that caveat, I believe the official documentation is here:
  https://gcc.gnu.org/onlinedocs/gccint/Machine-Desc.html

FWIW one of my colleagues wrote a series of posts about how to add an
entirely new CPU to the GNU toolchain here (originally called "ggx",
but now "moxie"):
  http://atgreen.github.io/ggx/
though that's from 2008 so might be out-of-date, and covers the whole
toolchain, not just GCC, so might be overwhelming.

Hope this is helpful
Dave


> 
> 
> 
> On Wed, May 25, 2022 at 4:14 PM David Malcolm 
> wrote:
> 
> > On Wed, 2022-05-25 at 10:25 +0530, RICHU NORMAN wrote:
> > > Hi,
> > > I am a beginner in gcc. I am trying to add an instruction to riscv-
> > > gcc.It
> > > would be helpful could help with a few tips .
> > 
> > Hi Richu - welcome to GCC development.
> > 
> > FWIW I've written a guide for new GCC contributors which you might
> > find
> > helpful:
> >   https://gcc-newbies-guide.readthedocs.io/en/latest/index.html
> > 
> > Caveat: I'm much more familiar with the frontends/diagnostics, rather
> > than the backends/RTL, so there may be a "frontend" bias in that
> > guide.
> > 
> > > 1.How to write comments to rtl or create a custom log file to log
> > > comments
> > > to rtl dump?
> > > 2.How to run testsuite ?
> > > 3.Is there a way to directly run an rtl test case? Like giving rtl
> > > input
> > > and checking the generated asm.(Like in the attachment which is
> > > posted in
> > > bugzilla[ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82815 ])
> > > Please suggest a way to run the gcc-testsuite with these cases. Pfa
> > 
> > I wrote some notes on dealing with the testsuite, and on running
> > individual cases here:
> > 
> >  
> > https://gcc-newbies-guide.readthedocs.io/en/latest/working-with-the-testsuite.html
> > 
> > Hope this is helpful; good luck
> > Dave
> > 
> > 
> 




Documentation format question

2022-05-25 Thread Andrew MacLeod via Gcc
I am going to get to some documentation for ranger and its components 
later this cycle.


I use to stick these sorts things on the wiki page, but i find that gets 
out of date really quickly.  I could add more comments to the top of 
each file, but that doesnt seem very practical for larger architectural 
descriptions, nor for APIs/use cases/best practices.   I could use 
google docs and turn it into a PDF or some other format, but that isnt 
very flexible.


Do we/anyone have any forward looking plans for GCC documentation that I 
should consider using?  It would be nice to be able to tie some of it 
into source files/classes in some way, but I am unsure of a decent 
direction.  It has to be easy to use, or I wont use it :-)  And i 
presume many others wouldn't either.  Im not too keep an manually 
marking up text either.


It would be nice if we had a central plan/direction that we were looking 
to adopt.  Is there such a thing I'm simply not aware of because I don't 
pay enough attention? I heard rumors on a gdb conversation that Marxin 
is dabbling/using/trying something for gcc docs?


Andrew





Re: GCC 9.5 Release Candidate available

2022-05-25 Thread Andrew Pinski via Gcc
On Fri, May 20, 2022 at 1:03 AM Richard Biener via Gcc  wrote:
>
>
> The first release candidate for GCC 9.5 is available from
>
> https://sourceware.org/pub/gcc/snapshots/9.5.0-RC-20220520/
>
> and shortly its mirrors.  It has been generated from git commit
> 1bc79c506205b6a5db82897340bdebaaf7ada934.
>
> I have so far bootstrapped and tested the release candidate
> on x86_64-suse-linux.
>
> Please test it and report any issues to bugzilla.
>
> If all goes well I'd like to release 9.5 on Friday, May 27th,
> which will then close the branch.

A brand new regression was just filed:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105732

This is a regression from 9.4.0 even.

Thanks,
Andrew


Re: [committed] exec-stack warning for test which wants executable stacks

2022-05-25 Thread Hans-Peter Nilsson via Gcc
> From: Jeff Law via Binutils 
> Date: Mon, 25 Apr 2022 17:30:59 +0200

> On 4/25/2022 9:26 AM, Nick Clifton wrote:
> > Hi Jeff,
> >
> >   Just FYI - I am also looking at adding in another warning.  This 
> > time for
> >   when the linker creates a PT_LOAD segment which has all of the RWX 
> > flags
> >   set.  At the moment my testing seems to show that it only causes 
> > problems
> >   when a custom linker script is used that defines its own program 
> > headers
> >   and does not provide separate headers for code and data.
> That also sounds quite reasonable.My biggest worry would be the 
> embedded targets which have their own linker scripts -- but like the 
> executable stack warning, I think you should go for it and we'll deal 
> with the fallout.

(Looks like I'm first to be hit by the
--enable-warn-rwx-segments default, or the first one to
bother, lucky me.)

So, with my autotester for cris-elf not able to update
binutils on its own because of all the warnings in the gcc
test-suite (all code and data get a single LOAD header,
which naturally is RWX), let's discuss a method for a
binutils target to default turn off this
configure-time-default-on warning.  I just don't think its
reasonable to require an extra configure option for the
intended default behavior for a target.

How about the usual method, a line in the ld emulparams
file for the target?

brgds, H-P