Hi Prathamesh,

Thanks for the report, I am running on a x86_64_linux_gnu and never had to
cross-compile before.
I've tried to set it up and reproduce your errors, please tell me if I'm
off the mark.

I configured gcc as:

../gcc/configure --prefix $CONTROL_PFX --disable-bootstrap
--host=x86_64-linux-gnu --target=arm-eabi --enable-languages=c --with-newlib

Then from the patch 7997f0d35efca8a24d1b0ceae5066b1019d633d7 prior to mine,
*I ran the tests manually as arm-sim refused to work*:
$GCC_SRC/control/eabi_arm_build/gcc/xgcc
-B$GCC_SRC/control//eabi_arm_build/gcc \

../../gcc/gcc/testsuite/gcc.dg/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early.c
\
  -fanalyzer -Wanalyzer-too-complex -fanalyzer-call-summaries
and
$GCC_SRC/control/eabi_arm_build/gcc/xgcc
-B$GCC_SRC/control//eabi_arm_build/gcc \

../../gcc/gcc/testsuite/gcc.dg/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c
\
  -fanalyzer -Wanalyzer-too-complex -fanalyzer-call-summaries -O2


>From my patch, I ran similar commands, only s/gcc.dg/c-c++-common/ as the
patch
moved the tests there.

The output were *identical*, for both pre/post-patched.
I do agree with you that there is an excess error compared to
x86_64-linux-gnu and the test expectations.

../../gcc/gcc/testsuite/gcc.dg/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early.c:63:65:
warning: converting a packed ‘enum obj_type’ pointer (alignment 1) to a
‘struct connection’ pointer (alignment 4) may result in an unaligned
pointer value [-Waddress-of-packed-member]
   63 |  return ((struct connection *)(((void *)(t)) - ((long)&((struct
connection *)0)->obj_type)));
      |
^~~~~~~~~~
../../gcc/gcc/testsuite/gcc.dg/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early.c:31:6:
note: defined here
   31 | enum obj_type {
      |      ^~~~~~~~
../../gcc/gcc/testsuite/gcc.dg/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early.c:47:8:
note: defined here
   47 | struct connection {
      |        ^~~~~~~~~~

Therefore I do also see a regression, but it does not come from
55f6a7d949abc708d1c6ebc01eb3053f96d1472b.
It seems like an easy fix though and I will add it to the second part of
this patch.

However I did run the tests manually, rather than with make check-gcc as it
failed to run - an issue with stdio not found.
I'm attending this issue and will further update you in case the conclusion
of this mail changes.

Thanks again,
Benjamin.

On Tue, Aug 29, 2023 at 8:47 AM Prathamesh Kulkarni <
prathamesh.kulka...@linaro.org> wrote:

> On Sat, 26 Aug 2023 at 18:02, Benjamin Priour via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
> >
> > From: benjamin priour <priour...@gmail.com>
> >
> > Hi,
> >
> > Updated version of the patch, regstrapping the changes described in
> > https://gcc.gnu.org/pipermail/gcc-patches/2023-August/628455.html.
> >
> > Regstrapped off trunk 66be6ed81f369573824f1a8f5a3538a63472292f
> > on x86_64-linux-gnu.
> Hi Benjamin,
> It seems your patch committed in 55f6a7d949abc708d1c6ebc01eb3053f96d1472b
> caused following regressions on arm-eabi config:
> Running gcc:gcc.dg/analyzer/analyzer.exp ...
> FAIL:
> c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c
> (test for excess errors)
> FAIL:
> c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early.c
> (test for excess errors)
>
> Please let me know if you need help to reproduce these failures.
>
> Thanks,
> Prathamesh
>
>

Reply via email to