public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Steve Kargl <sgk@troutmask.apl.washington.edu>
Cc: GCC Development <gcc@gcc.gnu.org>
Subject: Re: testsuite requires LTO?
Date: Tue, 12 Apr 2022 09:07:11 +0200	[thread overview]
Message-ID: <CAFiYyc2SsnpaCO29PgkJHPptBz6ZAPxV6z5sXR92ObP1cNu-Cg@mail.gmail.com> (raw)
In-Reply-To: <YlS/C6QHm7Y4v/Il@troutmask.apl.washington.edu>

On Tue, Apr 12, 2022 at 1:53 AM Steve Kargl via Gcc <gcc@gcc.gnu.org> wrote:
>
> If I configure gcc with the following
>
> ../gccx/configure --prefix=$HOME/work/x --enable-languages=c,c++,fortran \
>   --enable-bootstrap --disable-nls --enable-checking --disable-multilib \
>   --disable-libsanitizer --disable-lto.
>
> then bootstrap gcc, why do I see 1000s of failures with
>
> % cd gcc
> % gmake -j7 check-c
> ...
> FAIL: gcc.dg/torture/pr64365.c   -O2 -flto  (test for excess errors)
> FAIL: gcc.dg/torture/pr61786.c   -O2 -flto  (test for excess errors)
> FAIL: gcc.dg/torture/pr63380-2.c   -O2 -flto  (test for excess errors)
> FAIL: gcc.dg/torture/pr65270-2.c   -O2 -flto  (test for excess errors)
>
> Should the testsuite recognize that gcc is built without LTO support?

Yes, it does, in testsuite/lib/gcc-dg.exp

if [info exists TORTURE_OPTIONS] {
    set DG_TORTURE_OPTIONS $TORTURE_OPTIONS
} else {
    # It is theoretically beneficial to group all of the O2/O3 options together,
    # as in many cases the compiler will generate identical executables for
    # all of them--and the c-torture testsuite will skip testing identical
    # executables multiple times.
    # Also note that -finline-functions is explicitly included in one of the
    # items below, even though -O3 is also specified, because some ports may
    # choose to disable inlining functions by default, even when optimizing.
    set DG_TORTURE_OPTIONS [list \
        { -O0 } \
        { -O1 } \
        { -O2 } \
        { -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops
-ftracer -finline-functions } \
        { -O3 -g } \
        { -Os } ]

    if [check_effective_target_lto] {
        # When having plugin test both slim and fat LTO and plugin/nonplugin
        # path.
        if [check_linker_plugin_available] {
           set LTO_TORTURE_OPTIONS [list \
              { -O2 -flto -fno-use-linker-plugin -flto-partition=none } \
              { -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects }
           ]
        } else {
           set LTO_TORTURE_OPTIONS [list \
              { -O2 -flto -flto-partition=none } \
              { -O2 -flto }
           ]
        }

so either TORTURE_OPTIONS is set or check_effective_target_lto doesn't work.
The check does simply

    return [check_no_compiler_messages lto object {
        void foo (void) { }
    } "-flto"]

so I wonder what your excess errors are?  The check above should also
leave traces
in the testsuite log.  It might be that --disable-lto doesn't disable
gcc -c -flto but just
disables lto1 building though.

>
> --
> Steve

  reply	other threads:[~2022-04-12  7:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-11 23:51 Steve Kargl
2022-04-12  7:07 ` Richard Biener [this message]
2022-04-12  7:26   ` Richard Biener
2022-04-12 17:30     ` Steve Kargl
2022-04-12 17:42       ` Jonathan Wakely
2022-04-12 18:03         ` Steve Kargl
2022-04-12  7:41 ` Andreas Schwab

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=CAFiYyc2SsnpaCO29PgkJHPptBz6ZAPxV6z5sXR92ObP1cNu-Cg@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=sgk@troutmask.apl.washington.edu \
    /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).