public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/62663] New: m68k / coldfire : compiling with -msep-data breaks the code
@ 2014-09-01 22:35 angelo70 at gmail dot com
  2014-09-01 22:36 ` [Bug c/62663] " angelo70 at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: angelo70 at gmail dot com @ 2014-09-01 22:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62663

            Bug ID: 62663
           Summary: m68k / coldfire : compiling with -msep-data breaks the
                    code
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: angelo70 at gmail dot com

Created attachment 33430
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33430&action=edit
c file

Dear,

i am compiling a simple test file (attached), generated output includes non
coldfire mcf5307/m68k opcodes.

/toolchain_path/m68k-elf-gcc -I../../../../include -I../../include -D__KERNEL__
-DCONFIG_SYS_TEXT_BASE=0xffc00000 -Wall -Wstrict-prototypes
-Wno-format-security -fno-builtin -ffreestanding -fno-stack-protector -g
-Wno-format-nonliteral -fno-toplevel-reorder -D__M68K__ -mcpu=5307 -Os
-ffunction-sections -fdata-sections -ffixed-d7 -msep-data -pipe cpu_init_t.c -c

Wrong opcode is for the c call to square_tes() jpm (see after the 3 nop,
0x4e71).

removing "-msep-data" i see correct opcode.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/62663] m68k / coldfire : compiling with -msep-data breaks the code
  2014-09-01 22:35 [Bug c/62663] New: m68k / coldfire : compiling with -msep-data breaks the code angelo70 at gmail dot com
@ 2014-09-01 22:36 ` angelo70 at gmail dot com
  2014-09-02 11:57 ` [Bug target/62663] " mikpelinux at gmail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: angelo70 at gmail dot com @ 2014-09-01 22:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62663

--- Comment #1 from angelo <angelo70 at gmail dot com> ---
Created attachment 33431
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33431&action=edit
wrong object


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/62663] m68k / coldfire : compiling with -msep-data breaks the code
  2014-09-01 22:35 [Bug c/62663] New: m68k / coldfire : compiling with -msep-data breaks the code angelo70 at gmail dot com
  2014-09-01 22:36 ` [Bug c/62663] " angelo70 at gmail dot com
@ 2014-09-02 11:57 ` mikpelinux at gmail dot com
  2014-09-02 22:54 ` angelo70 at gmail dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mikpelinux at gmail dot com @ 2014-09-02 11:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62663

--- Comment #2 from Mikael Pettersson <mikpelinux at gmail dot com> ---
Without -msep-data gcc outputs

        jsr square_test

With -msep-data gcc outputs

        move.l square_test@GOT(%a5),%a0
        jsr (%a0)

Is that move.l unavailable on the mcf5307?  (I'm familiar with classic m68k but
not with the Coldfire line.)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/62663] m68k / coldfire : compiling with -msep-data breaks the code
  2014-09-01 22:35 [Bug c/62663] New: m68k / coldfire : compiling with -msep-data breaks the code angelo70 at gmail dot com
  2014-09-01 22:36 ` [Bug c/62663] " angelo70 at gmail dot com
  2014-09-02 11:57 ` [Bug target/62663] " mikpelinux at gmail dot com
@ 2014-09-02 22:54 ` angelo70 at gmail dot com
  2014-09-03  6:42 ` schwab@linux-m68k.org
  2015-01-16 18:33 ` law at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: angelo70 at gmail dot com @ 2014-09-02 22:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62663

--- Comment #3 from angelo <angelo70 at gmail dot com> ---
This is probably a non-bug.

I was confused last night, you are right, 


        move.l square_test@GOT(%a5),%a0
        jsr (%a0)

Is generated and is correct (move.l, instruction set is the same of m68k).
But this jump results to a next illegal instruction exception.

I see then %a5 loaded with 0xffc14900 (correct, see got in the .map file)
But, once loaded %a0, it contains a 0x70000000, that's a completely invalid
address.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/62663] m68k / coldfire : compiling with -msep-data breaks the code
  2014-09-01 22:35 [Bug c/62663] New: m68k / coldfire : compiling with -msep-data breaks the code angelo70 at gmail dot com
                   ` (2 preceding siblings ...)
  2014-09-02 22:54 ` angelo70 at gmail dot com
@ 2014-09-03  6:42 ` schwab@linux-m68k.org
  2015-01-16 18:33 ` law at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: schwab@linux-m68k.org @ 2014-09-03  6:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62663

--- Comment #4 from Andreas Schwab <schwab@linux-m68k.org> ---
Then this is most likely a linker bug, not setting up the GOT correctly.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/62663] m68k / coldfire : compiling with -msep-data breaks the code
  2014-09-01 22:35 [Bug c/62663] New: m68k / coldfire : compiling with -msep-data breaks the code angelo70 at gmail dot com
                   ` (3 preceding siblings ...)
  2014-09-03  6:42 ` schwab@linux-m68k.org
@ 2015-01-16 18:33 ` law at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: law at redhat dot com @ 2015-01-16 18:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62663

Jeffrey A. Law <law at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |law at redhat dot com
         Resolution|---                         |INVALID

--- Comment #5 from Jeffrey A. Law <law at redhat dot com> ---
Definitely not a GCC bug.  As Andreas mentioned, could easily be a linker
issue.  You'll want to file a bug with the binutils project:

https://sourceware.org/bugzilla/

Ideally you'll provide a linkable test.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-01-16 18:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-01 22:35 [Bug c/62663] New: m68k / coldfire : compiling with -msep-data breaks the code angelo70 at gmail dot com
2014-09-01 22:36 ` [Bug c/62663] " angelo70 at gmail dot com
2014-09-02 11:57 ` [Bug target/62663] " mikpelinux at gmail dot com
2014-09-02 22:54 ` angelo70 at gmail dot com
2014-09-03  6:42 ` schwab@linux-m68k.org
2015-01-16 18:33 ` law at redhat dot com

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).