On Tue, 25 Aug 2026, Alexandre Oliva wrote:
> On Aug 25, 2026, Alexandre Oliva <[email protected]> wrote:
>
> > Tested on x86_64-linux-gnu, ppc-elf and leon3-elf. I'm tempted to put
> > it in as obvious, but just in case someone would rather fix it
> > differently... Ok to install?
>
> Hmm, that would presumably still fail on mixed-endian systems.
>
> How about this? It requires either be or le, so that sso can be
> expected to work and bring about the desired result.
>
> The pr126650.c testcase carries an expectation that the data
> structures are little endian; we don't get the expected results
> otherwise. Make the nonscalars explicitly little-endian.
>
> Retested on x86_64-linux-gnu and ppc-elf. Ok?
OK.
Richard.
>
> for gcc/testsuite/ChangeLog
>
> PR tree-optimization/126650
> * gcc.dg/torture/pr126650.c: Be explicit about endianness
> expectations.
> ---
> gcc/testsuite/gcc.dg/torture/pr126650.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/gcc/testsuite/gcc.dg/torture/pr126650.c
> b/gcc/testsuite/gcc.dg/torture/pr126650.c
> index 166705d9cfe6d..befeba5259a4f 100644
> --- a/gcc/testsuite/gcc.dg/torture/pr126650.c
> +++ b/gcc/testsuite/gcc.dg/torture/pr126650.c
> @@ -1,4 +1,4 @@
> -/* { dg-do run } */
> +/* { dg-do run { target { le || be } } } */
>
> #include <stdarg.h>
> #include <stdlib.h>
> @@ -17,14 +17,14 @@ void __attribute__((noipa)) foo (int n, ...)
>
> int main()
> {
> - struct b {
> + struct __attribute__ ((scalar_storage_order ("little-endian"))) b {
> int : 7;
> int : 2;
> int : 6;
> int : 3;
> int c : 7;
> };
> - union {
> + union __attribute__ ((scalar_storage_order ("little-endian"))) {
> int d;
> struct b bf;
> char e[4];
>
>
>
>
--
Richard Biener <[email protected]>
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Jochen Jaser, Andrew McDonald, Abhinav Puri; (HRB 36809, AG Nuernberg)