public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gjl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/105753] [avr] ICE: in add_clobbers, at config/avr/avr-dimode.md:2705
Date: Sun, 23 Apr 2023 10:58:41 +0000	[thread overview]
Message-ID: <bug-105753-4-daTOKAsak3@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105753-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105753

--- Comment #18 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
(In reply to User99627 from comment #14)
> (In reply to fiesh from comment #13)
> > * While you failed to provide anything meaningful to the bug report (your
> > code snippet is not self-contained valid C code;  [...]
> 
> I failed?

Yepp.  As your test case works without LTO, all you have to do to get a valid
test case is to 

1) Add -v -save-temps to the command line options.

2) Provide that one pre-complied source file *.ii which triggers the ICE.

3) Provide the one command that avr-g++ issues to compile it.  Maybe specifics
of avr-g++ like its version are also interesting.  These are all printed with
-v.

The GCC bug reporting instructions explain that, see "Reporting Bugs" in
https://gcc.gnu.org/bugs/  This link is also shown when an ICE occurs, cf. your
Arduino logs.

There is a "What we need" section and also a "What we do not want" and
"Detailed bug reporting instructions" section to guide you.

> Nothing meaningful?

It doesn't help in reproducing the bug.

> So installing the Arduino IDE on your machine [...] is asking too much,

Speaking for myself: Yes.

Arduino will complile all of its core modules, stuff them in libs, and then
link all that stuff against the user modules intermingled with other commands
like ctags, ranlib and what not.  Why should anyone go through all of this if
*one* pre-compiled file is enough.  Lest alone installing software that has
nothing to do with GCC.

If it's too compicated for you, who is experienced with Arduino, to add "-v
-save-temps" to the compilation options; how is anybody else supposed to figure
out how to distill a test case from all of that.

A reasonable solution would be to report such problems to the Arduino bug
tracker.  If the Arduino maintainers would conclude that it's a genuine GCC
problem, then they would prepare a proper GCC bug report so that the GCC people
can reproduce the problem and work on it.

> Shall I post the complete Arduino library, plus the complete set of make and
> build commands (which I did!) to finally get some attention? What if it were
> a very complex case of internal bug that only requires a complex set of
> files for the bug to show itself?

As of bug reporting instructions: Please no binaries like libs.

There are two cases:

non-LTO: This is the easy case.  The problem occurs during compilation of one
translation unit.  Provide the pre-processed source *.ii and the command that
operates on it as described above.

LTO: By all means, try to find a test case that does not require LTO and thus
requires just one translation unit to reproduce.  If that fails, provide all
involved pre-processed sources and the avr-g++ calls that get you to the bug.
For N modules, this will be generation of N objects *.o from their *.ii
preprocessed sources, together with one final link that links the modules to
the final executable. For 2 modules, it would be something like

$ avr-g++ -mmcu=atmega8 -Os -flto -fpreprocessed  module1.ii -o module1.o
$ avr-g++ -mmcu=atmega8 -Os -flto -fpreprocessed  module2.ii -o module2.o
$ avr-g++ -mmcu=atmega8 -Os -flto module1.ii module2.ii -o modules.elf

IMO it would make sense that the Arduino people had a tool that helped their
users to produce valid bug reports.  This should be easy for the non-LTO case. 
For the LTO case, one would highly prefer a testcase as simple as possible, for
example by running creduce on *all* modules while keeping the bug alive. 

https://embed.cs.utah.edu/creduce/

Most of the creduce'd modules would turn out to be empty, thus not required for
the testcase.

> If I post a complete makefile with build instructions, will this bug
> be investigated?

A proper bug report as lined out above is a prerequisiteso  that the bug will
be inverstigated. It's necessary for investigation, but not sufficient.

The avr backend is plagued by a lack of supporters and people that are willing
to work on it and have the resources to do that.

  parent reply	other threads:[~2023-04-23 10:58 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-27 22:35 [Bug target/105753] New: " filip.hejsek at gmail dot com
2022-05-28  2:55 ` [Bug target/105753] " filip.hejsek at gmail dot com
2022-06-04 22:19 ` pinskia at gcc dot gnu.org
2022-06-12 23:41 ` filip.hejsek at gmail dot com
2022-06-12 23:48 ` pinskia at gcc dot gnu.org
2022-09-11 10:19 ` triffid.hunter at gmail dot com
2022-09-25 21:45 ` pinskia at gcc dot gnu.org
2022-10-02  8:06 ` rainer-gcc at wwad dot de
2022-12-09 14:26 ` fiesh at zefix dot tv
2022-12-09 14:31 ` fiesh at zefix dot tv
2023-01-25 18:45 ` user99627 at gmx dot com
2023-01-25 19:39 ` user99627 at gmx dot com
2023-01-31 23:26 ` user99627 at gmx dot com
2023-02-01  7:48 ` fiesh at zefix dot tv
2023-02-01 10:36 ` user99627 at gmx dot com
2023-04-20 19:55 ` gjl at gcc dot gnu.org
2023-04-20 20:40 ` [Bug rtl-optimization/105753] " gjl at gcc dot gnu.org
2023-04-21  7:47 ` gjl at gcc dot gnu.org
2023-04-21  9:00 ` gjl at gcc dot gnu.org
2023-04-23 10:58 ` gjl at gcc dot gnu.org [this message]
2023-05-20  5:53 ` cvs-commit at gcc dot gnu.org
2023-05-20  6:20 ` cvs-commit at gcc dot gnu.org
2023-05-20  6:35 ` cvs-commit at gcc dot gnu.org
2023-05-20  6:46 ` gjl at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-105753-4-daTOKAsak3@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).