From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 55118 invoked by alias); 10 Sep 2019 16:13:25 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 55080 invoked by uid 89); 10 Sep 2019 16:13:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-lj1-f172.google.com Received: from mail-lj1-f172.google.com (HELO mail-lj1-f172.google.com) (209.85.208.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Sep 2019 16:13:24 +0000 Received: by mail-lj1-f172.google.com with SMTP id 7so17033817ljw.7 for ; Tue, 10 Sep 2019 09:13:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:from:date:message-id:subject:to; bh=WleeAjwka9JR+a0vxrRm6cwTEH8MV5DKkV7uoDpuJEw=; b=exY2HIltWfiMLsOIhQzV8+tMZGFTxXmKfZZ4bpTEVdvZg8redygE2lKyKVsa3OgpAw EvYSRIeupx3FyxMdwJCAWgFFSfLSzgGsOMUxlWP0XajE6+q25LIVRnzDpJp99x2tdNKm phnT8UAVQUkirbGW0NMxdC+8t6azjiM7FueCerZ5mdflxfl/+pdfjS48ci11slJj8UC+ /xO6WHdu+n9QT5amlCbQ8oXVvx1FwJm/QpmRHIW5nGL9x3Tok7uNgPrC8VaLdEizldws o1c6syPjqmBQxth4IDQ0dSbETt6EYldprPnXoF2sDwy1ioWWcmsZza7kAnwmlCym+qHz qC2g== MIME-Version: 1.0 From: Christophe Lyon Date: Tue, 10 Sep 2019 16:13:00 -0000 Message-ID: Subject: [testsuite] Effective-target depending on current compiler flags? To: gcc Mailing List , Mike Stump Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg00071.txt.bz2 Hi, While looking at GCC validation results when configured for ARM cortex-m33 by default, I noticed that FAIL: gcc.target/arm/cmse/mainline/soft/cmse-5.c -march=armv8-m.main -mthumb -mfloat-abi=soft -O0 scan-assembler msr\tAPSR_nzcvqg, lr The corresponding line in the testcase is (are): /* { dg-final { scan-assembler "msr\tAPSR_nzcvq, lr" { target { ! arm_dsp } } } } */ /* { dg-final { scan-assembler "msr\tAPSR_nzcvqg, lr" { target arm_dsp } } } */ So the arm_dsp effective target is true and the test tries to match APSR_nzcvqg, while APSR_nzcvq is generated, as expected. There is an inconsistency because the testcase is compiled with -march=armv8-m.main, while arm_dsp is not: like most effective targets, it does not take the current cflags into account. In the present case, the -march flag is added by cmse.exp in the arguments to gcc-dg-runtest. I tried to add [current_compiler_flags] to all arm effective targets (for consistency, it wouldn't make sense to add it to arm_dsp only), but then I noticed further problems... For instance, in my configuration, when advsimd-intrinsics.exp is executed, it tries check_effective_target_arm_v8_2a_fp16_neon_hw which fails, and then tries check_effective_target_arm_neon_fp16_ok which succeeds and thus adds -mfloat-abi=softfp -mfp16-format=ieee to additional_flags. Since $additional_flags is passed to gcc-dg-runtest, these flags are visible by current_compiler_flags and taken into account when computing effective_targets (since I modified them). So... when computing arm_v8_2a_fp16_scalar_ok, it uses -mfloat-abi=softfp -mfp16-format=ieee and doesn't need to add any flag beyond -march=armv8.2-a+fp16. So et_arm_v8_2a_fp16_scalar_flags contains -march=armv8.2-a+fp16 only. Later on, while executing arm.exp, -mfloat-abi=softfp -mfp16-format=ieee are not part of $DEFAULT_CFLAGS as used by dg-runtest, but et_arm_v8_2a_fp16_scalar_flags is still in the cache and it's not valid anymore. So..... before burying myself, is there already a way to make effective-targets take the current compiler flags into account as needed in gcc.target/arm/cmse/mainline/soft/cmse-5.c ? Not sure my explanation is clear enough :-) Thanks, Christophe