From: "Roger Sayle" <roger@nextmovesoftware.com>
To: "'GCC Patches'" <gcc-patches@gcc.gnu.org>
Subject: [Committed] Correct testcase gcc.target/bfin/20090914-3.c
Date: Sun, 24 Oct 2021 14:31:16 +0100 [thread overview]
Message-ID: <007d01d7c8db$6cea81e0$46bf85a0$@nextmovesoftware.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 647 bytes --]
This patch cures the testsuite failure of bfin/20090914-3.c, which
currently FAILs on bfin-elf with "(test for excess errors)" due to:
20090914-3.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int]
which is obviously not what this code was intended to test. Fixed by
turning the code into a function returning the final "fract32" result,
as simply specifying an "int" return type for main, results in the
entire function being optimized away, as the result is unused.
Checked-in as obvious.
2021-10-24 Roger Sayle <roger@nextmovesoftware.com>
gcc/testsuite/ChangeLog
* gcc.target/bfin/20090914-3.c: Tweak test case.
Roger
--
[-- Attachment #2: patchj.txt --]
[-- Type: text/plain, Size: 634 bytes --]
diff --git a/gcc/testsuite/gcc.target/bfin/20090914-3.c b/gcc/testsuite/gcc.target/bfin/20090914-3.c
index fb0a9e1..6be5528 100644
--- a/gcc/testsuite/gcc.target/bfin/20090914-3.c
+++ b/gcc/testsuite/gcc.target/bfin/20090914-3.c
@@ -1,10 +1,11 @@
/* { dg-do compile { target bfin-*-* } } */
typedef long fract32;
-main() {
+fract32 foo() {
fract32 val_tmp;
fract32 val1 = 0x7FFFFFFF;
fract32 val2 = 0x40000000;
val_tmp = __builtin_bfin_mult_fr1x32x32 (0x06666667, val1);
val2 = __builtin_bfin_mult_fr1x32x32 (0x79999999, val2);
val2 = __builtin_bfin_add_fr1x32 (val_tmp, val2);
+ return val2;
}
reply other threads:[~2021-10-24 13:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='007d01d7c8db$6cea81e0$46bf85a0$@nextmovesoftware.com' \
--to=roger@nextmovesoftware.com \
--cc=gcc-patches@gcc.gnu.org \
/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).