Bug 51532 - Invalid Code Generated for cpu32.
Summary: Invalid Code Generated for cpu32.
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-13 19:20 UTC by Joel Sherrill
Modified: 2011-12-19 10:15 UTC (History)
0 users

See Also:
Host:
Target: m68k-rtems4.11
Build:
Known to work: 4.6.1
Known to fail:
Last reconfirmed: 2011-12-14 00:00:00


Attachments
Test case (6.36 KB, application/x-bzip)
2011-12-13 19:24 UTC, Joel Sherrill
Details
Patch (1.27 KB, text/plain)
2011-12-14 12:11 UTC, Andreas Schwab
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joel Sherrill 2011-12-13 19:20:15 UTC
/home2/joel/build/b-m68k-gcc/./gcc/xgcc -shared-libgcc -B/home2/joel/build/b-m68k-gcc/./gcc -nostdinc++ -L/home2/joel/build/b-m68k-gcc/m68k-rtems4.11/mcpu32/libstdc++-v3/src -L/home2/joel/build/b-m68k-gcc/m68k-rtems4.11/mcpu32/libstdc++-v3/src/.libs -nostdinc -B/home2/joel/build/b-m68k-gcc/m68k-rtems4.11/mcpu32/newlib/ -isystem /home2/joel/build/b-m68k-gcc/m68k-rtems4.11/mcpu32/newlib/targ-include -isystem /users/joel/test-gcc/gcc-svn/newlib/libc/include -B/users/joel/test-gcc/install-svn/m68k-rtems4.11/bin/ -B/users/joel/test-gcc/install-svn/m68k-rtems4.11/lib/ -isystem /users/joel/test-gcc/install-svn/m68k-rtems4.11/include -isystem /users/joel/test-gcc/install-svn/m68k-rtems4.11/sys-include -mcpu=cpu32 -I/users/joel/test-gcc/gcc-svn/libstdc++-v3/../libgcc -I/home2/joel/build/b-m68k-gcc/m68k-rtems4.11/mcpu32/libstdc++-v3/include/m68k-rtems4.11 -I/home2/joel/build/b-m68k-gcc/m68k-rtems4.11/mcpu32/libstdc++-v3/include -I/users/joel/test-gcc/gcc-svn/libstdc++-v3/libsupc++ -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=eh_tm.lo -g -O2 -mcpu=cpu32 -c /users/joel/test-gcc/gcc-svn/libstdc++-v3/libsupc++/eh_tm.cc -o eh_tm.o
/tmp/ccWdMzkS.s: Assembler messages:
/tmp/ccWdMzkS.s:63: Error: invalid instruction for this architecture; needs 68020 or higher (68020 [68k, 68ec020], 68030 [68ec030], 68040 [68ec040], 68060 [68ec060]) -- statement `cas.l %d0,%d1,-68(%a2)' ignored
/tmp/ccWdMzkS.s:190: Error: invalid instruction for this architecture; needs 68020 or higher (68020 [68k, 68ec020], 68030 [68ec030], 68040 [68ec040], 68060 [68ec060]) -- statement `cas.l %d0,%d1,-68(%a0)' ignored
/tmp/ccWdMzkS.s:296: Error: invalid instruction for this architecture; needs 68020 or higher (68020 [68k, 68ec020], 68030 [68ec030], 68040 [68ec040], 68060 [68ec060]) -- statement `cas.l %d0,%d1,-68(%a0)' ignored
/tmp/ccWdMzkS.s:785: Error: invalid instruction for this architecture; needs 68020 or higher (68020 [68k, 68ec020], 68030 [68ec030], 68040 [68ec040], 68060 [68ec060]) -- statement `cas.l %d1,%d0,-68(%a2)' ignored
Comment 1 Joel Sherrill 2011-12-13 19:23:43 UTC
xgcc (GCC) 4.7.0 20111207 (experimental) [trunk revision 182083]

m68k-rtems last completely compiled with this version:

m68k-rtems4.11-g++ (GCC) 4.7.0 20111104 (experimental) [trunk revision 180959]

This is a regression in the past month on the head.
Comment 2 Joel Sherrill 2011-12-13 19:24:37 UTC
Created attachment 26073 [details]
Test case
Comment 3 Andreas Schwab 2011-12-13 20:47:47 UTC
The use of cas is currently dependent on TARGET_68020, which is true on cpu32, but there needs to be a TARGET_CAS flag.
Comment 4 Andreas Schwab 2011-12-14 12:11:34 UTC
Created attachment 26079 [details]
Patch

Please try the attached patch.
Comment 5 Joel Sherrill 2011-12-14 15:38:43 UTC
This patch allows m68k-rtems4.11 to complete building the compiler and newlib with C and C++. 

I haven't tried other languages, built RTEMS itself, or run tests yet. But the patch looks good to me.
Comment 6 Andreas Schwab 2011-12-19 10:14:17 UTC
Author: schwab
Date: Mon Dec 19 10:14:13 2011
New Revision: 182475

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182475
Log:
PR target/51532
* config/m68k/m68k.h (FL_CAS, TARGET_CAS): Define.
* config/m68k/m68k.c (FL_FOR_isa_20): Add FL_CAS.
* config/m68k/sync.md: Use TARGET_CAS instead of (TARGET_68020 ||
TARGET_68040).

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/m68k/m68k.c
    trunk/gcc/config/m68k/m68k.h
    trunk/gcc/config/m68k/sync.md
Comment 7 Andreas Schwab 2011-12-19 10:15:03 UTC
Fixed.