public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Roger Sayle" <roger@nextmovesoftware.com>
To: "'Rainer Orth'" <ro@CeBiTec.Uni-Bielefeld.DE>,
	"'Andreas Schwab'" <schwab@linux-m68k.org>
Cc: <gcc-patches@gcc.gnu.org>
Subject: RE: [PING] PR middle-end/95126: Expand small const structs as immediate constants
Date: Mon, 6 Jun 2022 09:43:58 +0100	[thread overview]
Message-ID: <036701d87981$91cc3150$b56493f0$@nextmovesoftware.com> (raw)
In-Reply-To: <yddv8tezwc4.fsf@CeBiTec.Uni-Bielefeld.DE>


Hi Rainer (and Andreas),
My sincere apologies for the breakage.  I'm currently regression testing a
solution to the ICEs introduced by my "small const struct" patch, which
fingers-crossed might also fix this Ada bootstrap.  For a while when
Rainer also reported the bootstrap failure is visible, on
x86_64-pc-linux-gnu,
I thought I'd be able to diagnose and fix the issue myself, but alas my
--enable-languages="all" builds (still) fail earlier with:

gcc -std=gnu99 -c -g  -gnatpg -gnatwns -gnata -W -Wall -I- -I.
-Iada/generated -Iada -I../../gcc/gcc/ada ../../gcc/gcc/ada/osint.adb -o
ada/osint.o
osint.adb:438:31: "strlen" not declared in "CRTL"
osint.adb:441:14: "strncpy" not declared in "CRTL"
osint.adb:675:21: "strlen" not declared in "CRTL"
osint.adb:728:16: "Open_Append" is undefined
osint.adb:1108:41: "int64" not declared in "CRTL"
osint.adb:3144:28: "strlen" not declared in "CRTL"
osint.adb:3147:11: "strncpy" not declared in "CRTL"

The one experiment I'd like to be able to try, to investigate the cause/cure
of this, is:

diff --git a/gcc/calls.cc b/gcc/calls.cc
index a4336c1..05fdd24 100644
--- a/gcc/calls.cc
+++ b/gcc/calls.cc
@@ -2177,7 +2177,7 @@ load_register_parameters (struct arg_data *args, int
num_a
             VAR_DECL with a simple constructor, expand that constructor
             via a pseudo rather than read from (possibly misaligned)
             memory.  PR middle-end/95126.  */
-         else if (nregs == 1
+         else if (0 && nregs == 1
                   && partial == 0
                   && !args[i].pass_on_stack
                   && VAR_P (tree_value)

My "small const structs" patch affected code generation in three places, and
identifying
which of these is causing the miscompilation issue for gnat will help narrow
down the
problem, or worst case allow reverting less of the problematic patch.

Again my deep apologies for the breakage.  Hopefully the fix I'm testing
will cure this as
well (but an ICE is different symptom to a silent miscompilation).

Sorry again,
Roger
--

> -----Original Message-----
> From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
> Sent: 05 June 2022 21:31
> To: Andreas Schwab <schwab@linux-m68k.org>
> Cc: Roger Sayle <roger@nextmovesoftware.com>; gcc-patches@gcc.gnu.org
> Subject: Re: [PING] PR middle-end/95126: Expand small const structs as
> immediate constants
> 
> Andreas Schwab <schwab@linux-m68k.org> writes:
> 
> > This breaks Ada on aarch64 in stage3, probably a miscompiled stage2
> > compiler.  For example:
> >
> > /opt/gcc/gcc-20220605/Build/./prev-gcc/xgcc
> > -B/opt/gcc/gcc-20220605/Build/./prev-gcc/
> > -B/usr/aarch64-suse-linux/bin/ -B/usr/aarch64-suse-linux/bin/
> > -B/usr/aarch64-suse-linux/lib/ -isystem
> > /usr/aarch64-suse-linux/include -isystem
> > /usr/aarch64-suse-linux/sys-include -fchecking=1 -c -g -O2
> > -fchecking=1 -gnatpg -gnata -W -Wall -nostdinc -I- -I. -Iada/generated
> > -Iada -I../../gcc/ada -Iada/libgnat -I../../gcc/ada/libgnat
> > -Iada/gcc-interface -I../../gcc/ada/gcc-interface
> > ../../gcc/ada/spark_xrefs.adb -o ada/spark_xrefs.o
> > +===========================GNAT BUG
> > +DETECTED==============================+
> > | 13.0.0 20220605 (experimental) [master ad6919374be]
(aarch64-suse-linux)
> |
> > | Assert_Failure failed precondition from sinfo-nodes.ads:5419
|
> > | Error detected at types.ads:53:28
|
> > | Compiling ../../gcc/ada/spark_xrefs.adb
|
> > | Please submit a bug report; see https://gcc.gnu.org/bugs/ .
|
> > | Use a subject line meaningful to you and us to track the bug.
|
> > | Include the entire contents of this bug box in the report.
|
> > | Include the exact command that you entered.
|
> > | Also include sources listed below.
|
> >
> +================================================================
> =====
> > +=====+
> 
> Confirmed: this also happens on i386-pc-solaris2.11,
sparc-sun-solaris2.11, and
> x86_64-pc-linux-gnu.


  reply	other threads:[~2022-06-06  8:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-21 10:49 Roger Sayle
2022-06-05 17:53 ` Andreas Schwab
2022-06-05 20:31   ` Rainer Orth
2022-06-06  8:43     ` Roger Sayle [this message]
2022-06-06 11:16       ` Andreas Schwab
2022-06-06 11:23         ` Roger Sayle
2022-06-06 11:44           ` Andreas Schwab
2022-06-06 12:01         ` Rainer Orth
2022-06-06 12:00       ` Rainer Orth
2022-06-06 12:29         ` Roger Sayle
2022-06-06 15:52           ` Rainer Orth

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='036701d87981$91cc3150$b56493f0$@nextmovesoftware.com' \
    --to=roger@nextmovesoftware.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ro@CeBiTec.Uni-Bielefeld.DE \
    --cc=schwab@linux-m68k.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).