This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA:] Fix regressions on non-lto testruns due to disappearing -lm


On Sun, Nov 15, 2009 at 4:24 AM, Hans-Peter Nilsson
<hans-peter.nilsson@axis.com> wrote:
> I've seen a regression in my autotester for cris-elf appearing
> within (154097 154104], i.e. including the lto commit:
>
> Running /tmp/hpautotest-gcc1/gcc/gcc/testsuite/gcc.dg/torture/dg-torture.exp ...
> FAIL: gcc.dg/torture/pr41094.c ?-O0 ?(test for excess errors)
> WARNING: gcc.dg/torture/pr41094.c ?-O0 ?compilation failed to produce executable
>
> That test requires pow() at -O0, which is in libm.a, but there's
> no -lm on the command line. ?There's *usually* a -lm; if you run
> with RUNTESTFLAGS containing e.g. dg-torture.exp=pr41094.c there
> will be no FAIL.
>
> After some digging, it appears gcc.dg/lto/lto.exp simply removed
> -lm. ?Well, not really "simply": there's machinery to save,
> remove and afterwards restore it to the library options on the
> command-line but it was bailing out *after* modifying but
> *before* the restore for non-lto targets.
>
> This fixes it, checked with lto.exp dg-torture.exp in
> RUNTESTFLAGS for cris-elf. ?FWIW, check_effective_target_lto
> doesn't need the initialization functions being run, as it looks
> at a global variable ENABLE_LTO apparently intended to be set on
> the command-line.
>
> Ok?

Ok (looks obvious).

Thanks,
Richard.

> gcc/testsuite:
>
> ? ? ? ?gcc.dg/lto/lto.exp: For non-lto, bail out before calling
> ? ? ? ?init functions.
>
> --- lto.exp ? ? Wed Nov 11 21:53:43 2009
> +++ /tmp/lto.exp ? ? ? ?Sun Nov 15 11:05:12 2009
> @@ -34,17 +34,17 @@ load_lib gcc.exp
> ?# Load the language-independent compabibility support procedures.
> ?load_lib lto.exp
>
> +# If LTO has not been enabled, bail.
> +if { ![check_effective_target_lto] } {
> + ? ?return
> +}
> +
> ?gcc_init
> ?lto_init no-mathlib
>
> ?# Define an identifier for use with this suite to avoid name conflicts
> ?# with other lto tests running at the same time.
> ?set sid "c_lto"
> -
> -# If LTO has not been enabled, bail.
> -if { ![check_effective_target_lto] } {
> - ? ?return
> -}
>
> ?# Main loop.
> ?foreach src [lsort [find $srcdir/$subdir *_0.c]] {
>
> brgds, H-P
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]