Hello!

> I ran into this non-reproducible failure while testing a non-bootstrap build 
> on x86_64:
>
> ...
> PASS: g++.dg/ubsan/align-2.C   -Os  (test for excess errors)

I found the same problem on x86_64 CentOS 5.10 when testing with -m32:

gcc unix/-m32:

FAIL: c-c++-common/ubsan/align-2.c   -Os  execution test

g++ unix/-m32:

FAIL: c-c++-common/ubsan/align-2.c   -O2  execution test
FAIL: c-c++-common/ubsan/align-2.c   -O3 -fomit-frame-pointer  execution test
FAIL: c-c++-common/ubsan/align-2.c   -O3 -g  execution test
FAIL: c-c++-common/ubsan/align-2.c   -O2 -flto -flto-partition=none
execution test
FAIL: c-c++-common/ubsan/align-2.c   -O2 -flto  execution test
FAIL: c-c++-common/ubsan/align-4.c   -O1  execution test

The call to f4 in the following line triggers the failure:

  if (f2 (&v.u.e) + f3 (&v.u.e, 4) + f4 (&v.u.f.b) != 0)
    __builtin_abort ();

I find it interesting that adding a dummy char c; after long long b in:

struct T { char a; long long b; };

solves the problem for me.

However, running the executable under valgrind shows nothing interesting.

For reference:

$ /lib/libc.so.6
GNU C Library stable release version 2.5, by Roland McGrath et al.

Uros.

Reply via email to