Hi Rainer,
> > 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.
>
> I just tried this on i386-pc-solaris2.11: unfortunately, it made no
difference.
Awesome! Very many thanks for trying this. Alas it confirms that the patch
I'm currently spinning won't have any affect. So by a process of
elimination,
the miscompilation must be triggered by one of the other two changes:
diff --git a/gcc/expr.cc b/gcc/expr.cc
index fb062dc..37f1405 100644
--- a/gcc/expr.cc
+++ b/gcc/expr.cc
@@ -4871,7 +4871,7 @@ emit_push_insn (rtx x, machine_mode mode, tree type,
rtx s
/* If source is a constant VAR_DECL with a simple constructor,
store the constructor to the stack instead of moving it. */
const_tree decl;
- if (partial == 0
+ if (0 && partial == 0
&& MEM_P (xinner)
&& SYMBOL_REF_P (XEXP (xinner, 0))
&& (decl = SYMBOL_REF_DECL (XEXP (xinner, 0))) != NULL_TREE
@@ -10603,7 +10603,7 @@ expand_expr_real_1 (tree exp, rtx target,
machine_mode t
}
/* Expand const VAR_DECLs with CONSTRUCTOR initializers that
have scalar integer modes to a reg via store_constructor. */
- if (TREE_READONLY (exp)
+ if (0 && TREE_READONLY (exp)
&& !TREE_SIDE_EFFECTS (exp)
&& (modifier == EXPAND_NORMAL || modifier == EXPAND_STACK_PARM)
&& immediate_const_ctor_p (DECL_INITIAL (exp))
p.s. I've just set up a build environment on another machine where I'm
using
GNAT 11.3.1 20220421 (Red Hat 11.3.1-2)
as the bootstrap compiler, but it'll be a few hours before I'm investigating
in
gdb.
Many thanks again for your help. Sorry again for the
breakage/inconvenience.
Roger
==