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