https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64796

            Bug ID: 64796
           Summary: effective target bswap64 globally caches
                    target-specific use of lp64
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: trivial
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vries at gcc dot gnu.org

1. unix/: supported

$ make -k -j5 -d check-gcc 'RUNTESTFLAGS=dg.exp=optimize-bswapdi-1.c -v -v
--target_board=unix/'
...
Schedule of variations:
    unix/

Running target unix/
Running /home/vries/gcc_versions/devel/master/src/gcc/testsuite/gcc.dg/dg.exp
PASS: gcc.dg/optimize-bswapdi-1.c (test for excess errors)
PASS: gcc.dg/optimize-bswapdi-1.c scan-tree-dump-times bswap "64 bit bswap
implementation found at" 3
...


2. unix/-m32: unsupported

$ make -k -j5 -d check-gcc 'RUNTESTFLAGS=dg.exp=optimize-bswapdi-1.c -v -v
--target_board=unix/-m32':
...
Schedule of variations:
    unix/-m32

Running target unix/-m32
Running /home/vries/gcc_versions/devel/master/src/gcc/testsuite/gcc.dg/dg.exp
UNSUPPORTED: gcc.dg/optimize-bswapdi-1.c
...


3. unix/ unix/-m32: supported
$ make -k -j5 -d check-gcc 'RUNTESTFLAGS=dg.exp=optimize-bswapdi-1.c -v -v
--target_board=unix/\ unix/-m32'
...
Schedule of variations:
    unix/
    unix/-m32

Running target unix/
Running /home/vries/gcc_versions/devel/master/src/gcc/testsuite/gcc.dg/dg.exp 
PASS: gcc.dg/optimize-bswapdi-1.c (test for excess errors)
PASS: gcc.dg/optimize-bswapdi-1.c scan-tree-dump-times bswap "64 bit bswap
implementation found at" 3

Running target unix/-m32
Running /home/vries/gcc_versions/devel/master/src/gcc/testsuite/gcc.dg/dg.exp 
PASS: gcc.dg/optimize-bswapdi-1.c (test for excess errors)
PASS: gcc.dg/optimize-bswapdi-1.c scan-tree-dump-times bswap "64 bit bswap
implementation found at" 3
...


The bswap64 effective target is cached globally, so it caches the
target-specific use of lp64:
...
 Return 1 if the target supports 64-bit byte swap instructions.                 

proc check_effective_target_bswap64 { } {
    global et_bswap64_saved

    if [info exists et_bswap64_saved] {
        verbose "check_effective_target_bswap64: using cached result" 2
    } else {
        set et_bswap64_saved 0
        if { [is-effective-target bswap]
             && [is-effective-target lp64] } {
           set et_bswap64_saved 1
        }
    }

    verbose "check_effective_target_bswap64: returning $et_bswap64_saved" 2
    return $et_bswap64_saved
}
...

Note that the test passes with -m32, so maybe the effective target bswap64 is
not needed, or the wrong one.

Reply via email to