From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11500 invoked by alias); 17 May 2012 02:45:28 -0000 Received: (qmail 11368 invoked by uid 22791); 17 May 2012 02:45:26 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 17 May 2012 02:45:13 +0000 From: "ljalvs at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/53386] New: Bad assembly code produced for m68000 Date: Thu, 17 May 2012 04:05:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: blocker X-Bugzilla-Who: ljalvs at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-05/txt/msg01692.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53386 Bug #: 53386 Summary: Bad assembly code produced for m68000 Classification: Unclassified Product: gcc Version: 4.6.4 Status: UNCONFIRMED Severity: blocker Priority: P3 Component: target AssignedTo: unassigned@gcc.gnu.org ReportedBy: ljalvs@gmail.com Hi, I'm currently using gcc 4.2.4 to build uClinux for a 68000 target (68HC000 cpu). I've update my toolchain to newer tool versions but now gcc (4.6.4) is producing bad assembly for this target. I'm almost sure that it is producing only 68020 assembly code and/or ignoring the -m68000 switch (I checked that when specifying -m68000 or -m68020 gcc is producing the same assembly code). Here is a simple testcase (a line from the kernel where my system was hanging): C instruction (from 'proc_net_ns_init' function): [...] memcpy(netd->name, "net", 4); [...] 4.2.4 assembly output: [...] 60: 157c 006e 004d moveb #110,%a2@(77) 66: 157c 0065 004e moveb #101,%a2@(78) 6c: 157c 0074 004f moveb #116,%a2@(79) 72: 422a 0050 clrb %a2@(80) [...] 4.6.4 assembly output: [...] 42: 217c 6e65 7400 movel #1852142592,%a0@(77) 48: 004d [...] Since the opcode movel has an odd displacement, it is causing an address/bus error exception, halting the cpu. Another difference I've noticed while tracing the above issue, is the way parameters are placed in the stack for the function call: 4.2.4 assembly: [...] movel absolute_address,%sp- [...] 4.6.4 assembly: [...] moveaw value1,%a0 addal value2,%a0 movel %a0@,%sp- [...] This is not critical but at a first look, it look it has slower execution and produces larger code (is this correct?). Command line used in this test (from the kernel build): m68k-uclinux-gcc -m68000 -Wp,-MD,net/sunrpc/.rpc_pipe.o.d -isystem /usr/local/lib/gcc/m68k-uclinux/4.5.1/include -I/root/m68k/20120401/uClinux-dist/linux-3.x/arch/m68k/include -Iarch/m68k/include/generated -Iinclude -include /root/m68k/20120401/uClinux-dist/linux-3.x/include/linux/kconfig.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -pipe -DUTS_SYSNAME=\"uClinux\" -D__uClinux__ -fomit-frame-pointer -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -DCC_HAVE_ASM_GOTO -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(rpc_pipe)" -D"KBUILD_MODNAME=KBUILD_STR(sunrpc)" -c -o fs/proc/proc_net.o fs/proc/proc_net.c Anyone knows what is the latest gcc version where code for 68000 is still ok? (I didn't want to go and build version by version until I find the one that's broken...) Regards, Luis Alves