From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17802 invoked by alias); 28 Sep 2014 04:25:24 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 17780 invoked by uid 89); 28 Sep 2014 04:25:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.4 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,MEDICAL_SUBJECT,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-pd0-f173.google.com Received: from mail-pd0-f173.google.com (HELO mail-pd0-f173.google.com) (209.85.192.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 28 Sep 2014 04:25:16 +0000 Received: by mail-pd0-f173.google.com with SMTP id w10so5528137pde.18 for ; Sat, 27 Sep 2014 21:25:14 -0700 (PDT) X-Received: by 10.66.139.234 with SMTP id rb10mr13863440pab.104.1411878314229; Sat, 27 Sep 2014 21:25:14 -0700 (PDT) Received: from ShengShiZhuChengdeMacBook-Pro.local ([219.143.90.210]) by mx.google.com with ESMTPSA id xj9sm8831821pab.40.2014.09.27.21.25.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Sep 2014 21:25:13 -0700 (PDT) Message-ID: <54278EF7.6040602@gmail.com> Date: Sun, 28 Sep 2014 04:25:00 -0000 From: Chen Gang User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Michael Eager CC: Mike Stump , Jeff Law , gcc-patches List Subject: Re: [PATCH] microblaze: microblaze.md: Use VOID instead of SI to fix "((void (*)(void)) 0)()" issue References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-09/txt/msg02481.txt.bz2 And excuse me, I am not quite familiar with adding testsuite, so during I am trying, welcome any related ideas, suggestions or completions. Thanks. On 9/28/14 3:08, Chen Gang wrote: > I guess it is not in our test case, or after this patch, the new > should get a little better result than the old (at present, they are > same). > > I shall try to add related case into testsuite within this month. > > Thanks > > Send from Lenovo A788t. > > > > > > Michael Eager wrote: > > > > On 09/25/14 07:03, Chen Gang wrote: >> Need use VOID instead of SI, or when real VOIDmode comes, it does not >> match SImode, so cause issue. This patch can fix this issue and pass >> testsuite. >> >> The related test code ('void' will cause CALL instead of SET): >> >> typedef void (*T)(void); >> f1 () >> { >> ((T) 0)(); >> } >> >> The related error: >> >> [root@localhost gcc]# ./cc1 /tmp/calls.c -o /tmp/1.s >> f1 >> Analyzing compilation unit >> Performing interprocedural optimizations >> <*free_lang_data> Assembling functions: >> f1 >> /tmp/calls.c: In function 'f1': >> /tmp/calls.c:5:1: error: unrecognizable insn: >> } >> ^ >> (call_insn 5 2 8 2 (parallel [ >> (call (mem:SI (const_int 0 [0]) [0 MEM[(void (*) (void))0B] S4 A32]) >> (const_int 24 [0x18])) >> (clobber (reg:SI 15 r15)) >> ]) /tmp/calls.c:4 -1 >> (nil) >> (nil)) >> /tmp/calls.c:5:1: internal compiler error: in extract_insn, at recog.c:2204 >> 0xb0e71b _fatal_insn(char const*, rtx_def const*, char const*, int, char const*) >> ../../gcc/gcc/rtl-error.c:109 >> 0xb0e75c _fatal_insn_not_found(rtx_def const*, char const*, int, char const*) >> ../../gcc/gcc/rtl-error.c:117 >> 0xac552b extract_insn(rtx_def*) >> ../../gcc/gcc/recog.c:2204 >> 0x8b919e instantiate_virtual_regs_in_insn >> ../../gcc/gcc/function.c:1614 >> 0x8ba347 instantiate_virtual_regs >> ../../gcc/gcc/function.c:1934 >> 0x8ba452 execute >> ../../gcc/gcc/function.c:1983 >> Please submit a full bug report, >> with preprocessed source if appropriate. >> Please include the complete backtrace with any bug report. >> See for instructions. > > Is this test case (or a similar one) in the gcc test suite? > > If not, can you please add it to the test suite. > >> >> >> 2014-09-25 Chen Gang >> >> * config/microblaze/microblaze.md (call_internal1): Use VOID >> instead of SI to fix "((void (*)(void)) 0)()" issue >> >> --- >> gcc/config/microblaze/microblaze.md | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md >> index b971737..3b4faf4 100644 >> --- a/gcc/config/microblaze/microblaze.md >> +++ b/gcc/config/microblaze/microblaze.md >> @@ -2062,7 +2062,7 @@ >> (set_attr "length" "4")]) >> >> (define_insn "call_internal1" >> - [(call (mem (match_operand:SI 0 "call_insn_simple_operand" "ri")) >> + [(call (mem (match_operand:VOID 0 "call_insn_simple_operand" "ri")) >> (match_operand:SI 1 "" "i")) >> (clobber (reg:SI R_SR))] >> "" > > I've verified that your patch does not cause any test suite regressions. > > -- Chen Gang Open, share, and attitude like air, water, and life which God blessed