[Bug libgcc/109121] New: m68k/coldfire: multilib: arithmetic functions missing

2023-03-14 Thread angelo70 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109121

Bug ID: 109121
   Summary: m68k/coldfire: multilib: arithmetic functions missing
   Product: gcc
   Version: 12.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libgcc
  Assignee: unassigned at gcc dot gnu.org
  Reporter: angelo70 at gmail dot com
  Target Milestone: ---

Hi all,

i am using the following toolchain, from kernel.org, to build
the whole range of coldfire-based boards in u-boot.

/opt/toolchains/m68k/gcc-12.2.0-nolibc/m68k-linux/bin/m68k-linux-gcc -v 
Using built-in specs.
COLLECT_GCC=/opt/toolchains/m68k/gcc-12.2.0-nolibc/m68k-linux/bin/m68k-linux-gcc
COLLECT_LTO_WRAPPER=/opt/toolchains/m68k/gcc-12.2.0-nolibc/m68k-linux/bin/../libexec/gcc/m68k-linux/12.2.0/lto-wrapper
Target: m68k-linux
Configured with: /home/arnd/git/gcc/configure --target=m68k-linux
--enable-targets=all
--prefix=/home/arnd/cross/x86_64/gcc-12.2.0-nolibc/m68k-linux
--enable-languages=c --without-headers --disable-bootstrap --disable-nls
--disable-threads --disable-shared --disable-libmudflap --disable-libssp
--disable-libgomp --disable-decimal-float --disable-libquadmath
--disable-libatomic --disable-libcc1 --disable-libmpx --enable-checking=release
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 12.2.0 (GCC)

  m68k:  +   M5253DEMO
+m68k-linux-ld.bfd: board/freescale/m5253demo/flash.o: in function
`flash_print_info':
+board/freescale/m5253demo/flash.c:107: undefined reference to `__fixsfsi'
+m68k-linux-ld.bfd: arch/m68k/lib/mulsf3.o: in function `__mulsf3':
+arch/m68k/lib/mulsf3.c:5: undefined reference to `__extendsfdf2'
+m68k-linux-ld.bfd: arch/m68k/lib/mulsf3.c:5: undefined reference to
`__mulXf3__'
+make[1]: *** [Makefile:1754: u-boot] Error 1
+make: *** [Makefile:177: sub-make] Error 2


  m68k:  +   M5249EVB
+m68k-linux-ld.bfd: m68k:isa-a:mac architecture of input file
`arch/m68k/lib/ashldi3.o' is incompatible with m68k:isa-a:emac output
+m68k-linux-ld.bfd: m68k:isa-a:mac architecture of input file
`arch/m68k/lib/lshrdi3.o' is incompatible with m68k:isa-a:emac output
+m68k-linux-ld.bfd: m68k:isa-a:mac architecture of input file
`arch/m68k/lib/muldi3.o' is incompatible with m68k:isa-a:emac output
+make[1]: *** [Makefile:1754: u-boot] Error 1
+make: *** [Makefile:177: sub-make] Error 2
  m68k:  +   amcore
+m68k-linux-ld.bfd: m68k:isa-aplus:emac architecture of input file
`arch/m68k/lib/ashldi3.o' is incompatible with m68k:isa-a:mac output
+m68k-linux-ld.bfd: m68k:isa-aplus:emac architecture of input file
`arch/m68k/lib/lshrdi3.o' is incompatible with m68k:isa-a:mac output
+m68k-linux-ld.bfd: m68k:isa-aplus:emac architecture of input file
`arch/m68k/lib/muldi3.o' is incompatible with m68k:isa-a:mac output
+make[1]: *** [Makefile:1754: u-boot] Error 1
+make: *** [Makefile:177: sub-make] Error 2


Also tested same version built here, enabling multilib:

/opt/toolchains/m68k/m68k-kernelspace-elf/bin/m68k-kernelspace-elf-gcc -v   
Using built-in specs.
COLLECT_GCC=/opt/toolchains/m68k/m68k-kernelspace-elf/bin/m68k-kernelspace-elf-gcc
COLLECT_LTO_WRAPPER=/opt/toolchains/m68k/m68k-kernelspace-elf/bin/../libexec/gcc/m68k-kernelspace-elf/12.2.0/lto-wrapper
Target: m68k-kernelspace-elf
Configured with:
/home/angelo/dev-kernelspace/crosstool-ng/.build/m68k-kernelspace-elf/src/gcc/configure
--build=x86_64-build_pc-linux-gnu --host=x86_64-build_pc-linux-gnu
--target=m68k-kernelspace-elf
--prefix=/home/angelo/dev-kernelspace/crosstool-ng/x-tools/m68k-kernelspace-elf
--exec_prefix=/home/angelo/dev-kernelspace/crosstool-ng/x-tools/m68k-kernelspace-elf
--with-local-prefix=/home/angelo/dev-kernelspace/crosstool-ng/x-tools/m68k-kernelspace-elf/m68k-kernelspace-elf
--with-headers=/home/angelo/dev-kernelspace/crosstool-ng/x-tools/m68k-kernelspace-elf/m68k-kernelspace-elf/include
--with-newlib --enable-threads=no --disable-shared
--with-pkgversion='crosstool-NG 1.25.0.131_ee5a402_dirty' --enable-__cxa_atexit
--disable-libgomp --disable-libmudflap --disable-libmpx --disable-libssp
--disable-libquadmath --disable-libquadmath-support --disable-libstdcxx-verbose
--with-gmp=/home/angelo/dev-kernelspace/crosstool-ng/.build/m68k-kernelspace-elf/buildtools
--with-mpfr=/home/angelo/dev-kernelspace/crosstool-ng/.build/m68k-kernelspace-elf/buildtools
--with-mpc=/home/angelo/dev-kernelspace/crosstool-ng/.build/m68k-kernelspace-elf/buildtools
--with-isl=/home/angelo/dev-kernelspace/crosstool-ng/.build/m68k-kernelspace-elf/buildtools
--disable-lto --enable-default-pie --enable-target-optspace --disable-nls
--enable-multiarch --with-multilib-list=5253,5329,5373 --enable-languages=c
--disable-shared
Thread model: single
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (crosstool-NG 1.25.0.131_ee5a402_dirty)


Still getting some

mcf54415
+m68k-kernelspace-elf-ld.bfd: m68k:isa-a:mac architecture of input file
`arch/m68k/lib

[Bug c++/107798] optimizing -O3, "for" loop condition not checked anymore

2022-11-21 Thread angelo70 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107798

--- Comment #6 from angelo  ---
Thanks a lot. Clear now.

[Bug c++/107798] optimizing -O3, "for" loop condition not checked anymore

2022-11-21 Thread angelo70 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107798

--- Comment #3 from angelo  ---
Hi Andrew,

thanks, anyway, even if accessing on read a wrong memory address, shouldn't
anyway i < 3 * 3 be respected anyway, due to && ? With -O3 the code goes far
over 9.

[Bug c++/107798] New: optimizing -O3, "for" loop condition not checked anymore

2022-11-21 Thread angelo70 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107798

Bug ID: 107798
   Summary: optimizing -O3, "for" loop condition not checked
anymore
   Product: gcc
   Version: 12.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: angelo70 at gmail dot com
  Target Milestone: ---

Created attachment 53938
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53938=edit
sample code of the bug

Hi,

in the attached code, i < 3 * 3 is not checked anymore when optimizing by -O3.

This is visible disassembling. With -O3 the disassembled code only checks for a
zero-termination of the array, not finding it, it is proceeding over 8.

Checking for zero-termination seems a wrong assumption, for loop should never
pass over 8 in any case.

[Bug target/68467] libgcc, compilation for target m68k-linux breaks in linux_atomic.c

2017-06-25 Thread angelo70 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68467

--- Comment #17 from angelo  ---
Hi Carlos,

maybe you can try one of these 2 toolchains i prepared years ago:

http://sysam.it/toolchains.html

Regads,
Angelo

On 25/06/2017 20:40, csotoalonso at gmail dot com wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68467
>
> Carlos Soto  changed:
>
> What|Removed |Added
> 
>   CC||csotoalonso at gmail dot com
>
> --- Comment #16 from Carlos Soto  ---
> Any news on this bug?
>
> Currently I'm trying to get a 5485 board working with linux and I'm facing the
> fact that there's no working toolchain available anymore.
>
> It would be great to have this old boards up and running again
>

[Bug libgcc/68082] issue on 64 bit shift

2016-09-12 Thread angelo70 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68082

--- Comment #7 from angelo  ---
Hi Andrew,

it is passed some time, i solved mainly the issue with a workaround.

Yes i tested several binutils even last, but is more a matter of compiling the
m68k/coldfire toolchain properly.

Mainly, building if i build the toolchain for m68k with default flags, only
m68000 default code is added in gcc multilibs (and it is used later when i buil
m68k apps with 64 bit shift). 

While, if i try to to build with flags for coldfire (--with-arch=cf) this
breaks the compilation, i should have reported some other error about here in
bugtracking.

My workaround was to copy libgcc.a and coldfire subfolder from another older
working toolchain.

Regards
angelo

[Bug libgcc/68467] libgcc, compilation for target m68k-linux breaks in linux_atomic.c, #define COMMA ,

2016-04-17 Thread angelo70 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68467

--- Comment #2 from angelo  ---
Well the final error is :

/home/angelo/archivio/aziende/sysam/buildall/gcc-5.2.0/libgcc/config/m68k/linux-atomic.c:198:13:
internal compiler error: in emit_library_call_value_1, at calls.c:4401
 return (__sync_val_compare_and_swap_##WIDTH (ptr, oldval, newval) \
 ^
/home/angelo/archivio/aziende/sysam/buildall/gcc-5.2.0/libgcc/config/m68k/linux-atomic.c:203:1:
note: in expansion of macro 'SUBWORD_BOOL_CAS'
 SUBWORD_BOOL_CAS (unsigned char,  1)

I tried also gcc 5.3.0, same error using --with-arch=cf.

Seems like m68k branch is not considered at all.

[Bug libgcc/68082] issue on 64 bit shift

2016-04-17 Thread angelo70 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68082

--- Comment #5 from angelo  ---
Any news ?

Trying also --with-arch=cf breaks the compilation.
So i can't have in any way valid libgcc code i.e. for m5307.

[Bug target/53833] m68k-uclinux xgcc ICE when compiling libgcc (linux-atomic.c:203:1: in emit_library_call_value_1, at calls.c:4146)

2016-04-16 Thread angelo70 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53833

angelo  changed:

   What|Removed |Added

 CC||angelo70 at gmail dot com

--- Comment #5 from angelo  ---
There are 5 comments with related job to collect logs and help gcc community,
and other as me facing similar issues compiling with "--with-arch=cf".

I know gcc is an open community and we can't pretend anything,
anyway, at least a reply in 4 years would be good.

[Bug libgcc/68466] libgcc, linux_atomic.c, compilation breaks on #include

2015-11-21 Thread angelo70 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68466

angelo  changed:

   What|Removed |Added

 Status|RESOLVED|UNCONFIRMED
 Resolution|INVALID |---

--- Comment #5 from angelo  ---

Hi Andreas,

thanks,

i installed kernel headers, and configured now with 

EXTRA_GCC_CONF="--enable-multilib
--with-sysroot=/home/angelo/archivio/aziende/sysam/buildall/sysroot
--with-arch=cf --with-newlib --with-system-zlib"

with kernel headers set in sysroot/usr/include

Still same erorr.

/home/angelo/archivio/aziende/sysam/buildall/m68k/gcc/./gcc/xgcc
-B/home/angelo/archivio/aziende/sysam/buildall/m68k/gcc/./gcc/
-B/home/angelo/archivio/aziende/sysam/buildall/output/m68k-linux/bin/
-B/home/angelo/archivio/aziende/sysam/buildall/output/m68k-linux/lib/ -isystem
/home/angelo/archivio/aziende/sysam/buildall/output/m68k-linux/include -isystem
/home/angelo/archivio/aziende/sysam/buildall/output/m68k-linux/sys-include   
-g -O2 -mcpu=54455 -Wa,-mno-mac -O2  -g -O2 -DIN_GCC 
-DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition 
-isystem ./include   -fPIC -g -DIN_LIBGCC2 -fbuilding-libgcc
-fno-stack-protector -Dinhibit_libc  -fPIC -I. -I. -I../../.././gcc
-I/home/angelo/archivio/aziende/sysam/buildall/gcc-5.2.0/libgcc
-I/home/angelo/archivio/aziende/sysam/buildall/gcc-5.2.0/libgcc/.
-I/home/angelo/archivio/aziende/sysam/buildall/gcc-5.2.0/libgcc/../gcc
-I/home/angelo/archivio/aziende/sysam/buildall/gcc-5.2.0/libgcc/../include 
-DHAVE_CC_TLS  -o linux-atomic.o -MT linux-atomic.o -MD -MP -MF
linux-atomic.dep  -c
/home/angelo/archivio/aziende/sysam/buildall/gcc-5.2.0/libgcc/config/m68k/linux-atomic.c
-fvisibility=hidden -DHIDE_EXPORTS
/home/angelo/archivio/aziende/sysam/buildall/gcc-5.2.0/libgcc/config/m68k/linux-atomic.c:36:24:
fatal error: asm/unistd.h: No such file or directory
compilation terminated.

I can do something wrong, of course, but i don't see any sysroot reference in
the line producing the error.

I attach the full logs.

[Bug libgcc/68466] libgcc, linux_atomic.c, compilation breaks on #include

2015-11-21 Thread angelo70 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68466

--- Comment #7 from angelo  ---
Created attachment 36795
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36795=edit
gcc build

[Bug libgcc/68466] libgcc, linux_atomic.c, compilation breaks on #include

2015-11-21 Thread angelo70 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68466

--- Comment #6 from angelo  ---
Created attachment 36794
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36794=edit
gcc configure

[Bug libgcc/68466] libgcc, linux_atomic.c, compilation breaks on #include

2015-11-21 Thread angelo70 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68466

--- Comment #9 from angelo  ---
Hi Andreas,

thanks. Not sure if i have to open another bug tracking. Now, with headers in
sysroot, issue is solved so this bug can stay closed, but i get another error.

/home/angelo/archivio/aziende/sysam/buildall/gcc-5.2.0/libgcc/config/m68k/linux-atomic.c:198:13:
internal compiler error: in emit_library_call_value_1, at calls.c:4401


Very similar to this

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

Regards,
angelo

[Bug libgcc/68466] libgcc, linux_atomic.c, compilation breaks on #include

2015-11-21 Thread angelo70 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68466

--- Comment #1 from angelo  ---
Sorry, forgot to mention compiler i am using to build:

$ gcc --version
gcc (Debian 5.2.1-21) 5.2.1 20151003
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[Bug libgcc/68466] libgcc, linux_atomic.c, compilation breaks on #include

2015-11-21 Thread angelo70 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68466

angelo  changed:

   What|Removed |Added

 Status|RESOLVED|UNCONFIRMED
 Resolution|INVALID |---

--- Comment #3 from angelo  ---
andreas,

considering the effort the users spend filling bugs, 
it would be nice, if possible, if you can spend some additional words for a
more user-friendly explanation.

In particular, what does it mean "is needed for __NR_atomic_cmpxchg_32" ?
Compilation, as is, breaks. So mainly i'm interested to understand if i am
using some wrong config option.

I found references that patches for this issue has been applied to gcc for
other architectures.

http://lists.busybox.net/pipermail/buildroot/2015-August/135272.html

[Bug libgcc/68467] libgcc, compilation for target m68k-linux breaks in linux_atomic.c, #define COMMA ,

2015-11-21 Thread angelo70 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68467

--- Comment #1 from angelo  ---
Created attachment 36792
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36792=edit
build log

[Bug libgcc/68467] New: libgcc, compilation for target m68k-linux breaks in linux_atomic.c, #define COMMA ,

2015-11-21 Thread angelo70 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68467

Bug ID: 68467
   Summary: libgcc, compilation for target m68k-linux breaks in
linux_atomic.c, #define COMMA ,
   Product: gcc
   Version: 5.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libgcc
  Assignee: unassigned at gcc dot gnu.org
  Reporter: angelo70 at gmail dot com
  Target Milestone: ---

Created attachment 36791
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36791=edit
config log

Dear all,

after had filled 68466, and applied the workaround mentioned in it, i can fully
compile gcc. Btw, inside libgcc i see only M68000 code, and not coldfire
variants.

So i am trying with different configuration options, as:

EXTRA_GCC_CONF="--enable-multilib --with-arch=cf --with-newlib
--with-system-zlib"

With config options above, i get following error compiling:

/home/angelo/archivio/aziende/sysam/buildall/m68k/gcc/./gcc/xgcc
-B/home/angelo/archivio/aziende/sysam/buildall/m68k/gcc/./gcc/
-B/home/angelo/archivio/aziende/sysam/output/m68k-linux/bin/
-B/home/angelo/archivio/aziende/sysam/output/m68k-linux/lib/ -isystem
/home/angelo/archivio/aziende/sysam/output/m68k-linux/include -isystem
/home/angelo/archivio/aziende/sysam/output/m68k-linux/sys-include-g -O2
-mcpu=54455 -Wa,-mno-mac -O2  -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W
-Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fPIC -g
-DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc  -fPIC -I.
-I. -I../../.././gcc
-I/home/angelo/archivio/aziende/sysam/buildall/gcc-5.2.0/libgcc
-I/home/angelo/archivio/aziende/sysam/buildall/gcc-5.2.0/libgcc/.
-I/home/angelo/archivio/aziende/sysam/buildall/gcc-5.2.0/libgcc/../gcc
-I/home/angelo/archivio/aziende/sysam/buildall/gcc-5.2.0/libgcc/../include 
-DHAVE_CC_TLS  -o linux-atomic.o -MT linux-atomic.o -MD -MP -MF
linux-atomic.dep  -c
/home/angelo/archivio/aziende/sysam/buildall/gcc-5.2.0/libgcc/config/m68k/linux-atomic.c
-fvisibility=hidden -DHIDE_EXPORTS
/home/angelo/archivio/aziende/sysam/buildall/gcc-5.2.0/libgcc/config/m68k/linux-atomic.c:
In function '__sync_lock_test_and_set_4':
/home/angelo/archivio/aziende/sysam/buildall/gcc-5.2.0/libgcc/config/m68k/linux-atomic.c:207:15:
warning: left-hand operand of comma expression has no effect [-Wunused-value]
 #define COMMA ,
   ^
/home/angelo/archivio/aziende/sysam/buildall/gcc-5.2.0/libgcc/config/m68k/linux-atomic.c:80:31:
note: in definition of macro 'WORD_SYNC_OP'
   newval = PFX_OP (oldval INF_OP val);\


Compiling on x86_64 os
$ gcc --version
gcc (Debian 5.2.1-21) 5.2.1 20151003
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.



I attach configure and build logs.

Regards

[Bug libgcc/68082] issue on 64 bit shift

2015-11-20 Thread angelo70 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68082

--- Comment #3 from angelo  ---
Created attachment 36787
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36787=edit
code that generate the fault

[Bug libgcc/68082] issue on 64 bit shift

2015-11-20 Thread angelo70 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68082

--- Comment #2 from angelo  ---
Hi,

finally i have more details.

I reproduce this issue on toolchains built for x86_64, from gcc 4.9.0 to latest
gcc 5.2.0.

Compiling options don't make great differences, i am actually using

-ggdb -Wall -fno-builtin -ffreestanding -O0 -pipe -mcpu=5307

and forcing libgcc __lshrdi3 to be called from c source.

The line .short 0x48e7 create the issue. It brings of course to a
fault.

__lshrdi3 (DWtype u, shift_count_type b)
{
ffc1094c:   4e56    linkw %fp,#0
ffc10950:   48e7.short 0x48e7

I attach all i have to help you.

[Bug libgcc/68082] issue on 64 bit shift

2015-11-20 Thread angelo70 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68082

--- Comment #4 from angelo  ---
Here what i see when i step into the function:

http://imgur.com/2802Ob5

I build on linux

$ cat /proc/version 
Linux version 4.1.7001 (root@jerusalem) (gcc version 5.2.1 20150911 (Debian
5.2.1-17) ) #1 SMP Sat Sep 19 15:29:17 CEST 2015

Compiling with -Wall -Wextra doesn't show anything wrong.

Same using -fno-strict-aliasing -fwrapv -fno-aggressive-loop-optimizations, no
changes, i still see

0x2768  linkw %fp,#0
0x276c  .short 0x48e7
0x276e  movew %d0,%d4
0x2770  movel %fp@(8),%d2
0x2774  movel %fp@(12),%d1
0x2778  movel %fp@(16),%d3
...

-fsanitize=undefined  produces compile time errors intead: 
/home/angelo/archivio/aziende/sysam/u-boot-extras/4.9.0_issue/main.c|30|undefined
reference to `__ubsan_handle_type_mismatch'|


Command line that reproduce the issue:

Running command: make -f makefile
/opt/toolchains/m68k/gcc-5.2.0-nolibc/bin/m68k-linux-gcc -Wall -Wextra -ggdb
-fno-builtin -fno-strict-aliasing -fwrapv -fno-aggressive-loop-optimizations
-ffreestanding -O0 -pipe -mcpu=5307 -c -o main.o main.c
/opt/toolchains/m68k/gcc-5.2.0-nolibc/bin/m68k-linux-ld.bfd -n -Bstatic
-Tram.ld -Map test.map boot.o main.o -o test.bin -L
/opt/toolchains/m68k/gcc-5.2.0-nolibc/lib/gcc/m68k-linux/5.2.0 -lgcc
Process terminated with status 0 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))

Regards

[Bug libgcc/68466] New: libgcc, linux_atomic.c, compilation breaks on #include

2015-11-20 Thread angelo70 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68466

Bug ID: 68466
   Summary: libgcc, linux_atomic.c, compilation breaks on #include

   Product: gcc
   Version: 5.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libgcc
  Assignee: unassigned at gcc dot gnu.org
  Reporter: angelo70 at gmail dot com
  Target Milestone: ---

Created attachment 36790
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36790=edit
compilation log

Dear all,

building gcc-5.2.0 using as target m68k-linux, compilation breaks here:

cc1: error: no include path in which to search for stdc-predef.h
/home/angelo/archivio/aziende/sysam/buildall/gcc-5.2.0/libgcc/config/m68k/linux-atomic.c:36:24:
fatal error: asm/unistd.h: No such file or directory


Workaround is to comment out  #include  in linux-atomic.c

As done for other architecture, m68k branch should be fixed too.

Building on host:

$ cat /proc/version 
Linux version 4.1.7001 (root@jerusalem) (gcc version 5.2.1 20150911 (Debian
5.2.1-17) ) #1 SMP Sat Sep 19 15:29:17 CEST 2015


Compilation log attached.

[Bug libgcc/68082] New: issue on 64 bit shift

2015-10-24 Thread angelo70 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68082

Bug ID: 68082
   Summary: issue on 64 bit shift
   Product: gcc
   Version: 4.9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libgcc
  Assignee: unassigned at gcc dot gnu.org
  Reporter: angelo70 at gmail dot com
  Target Milestone: ---

Dear all,

testing gcc 4.9.0 toolchain for mcf5307 (coldfire) the code on target hangs
(loops) on a 64 bit shift opration (between 2 nop's i put).
I see that code (64 bit shift) is added from libgcc.

ffc0ee2e :
ffc0ee2e:   4e56 ffd0   linkw %fp,#-48
ffc0ee32:   48d7 3c7c   moveml %d2-%d6/%a2-%a5,%sp@
ffc0ee36:   2f2d 03d8   movel %a5@(984),%sp@-
ffc0ee3a:   4282clrl %d2
ffc0ee3c:   347c 003c   moveaw #60,%a2
ffc0ee40:   266d 0008   moveal %a5@(8),%a3
ffc0ee44:   4e93jsr %a3@
ffc0ee46:   588faddql #4,%sp
ffc0ee48:   262d 051c   movel %a5@(1308),%d3

ffc0ee4c:   4e71nop
ffc0ee4e:   2043moveal %d3,%a0
ffc0ee50:   2f0amovel %a2,%sp@-
ffc0ee52:   2f2e 000c   movel %fp@(12),%sp@-
ffc0ee56:   2f2e 0008   movel %fp@(8),%sp@-
ffc0ee5a:   4e90jsr %a0@
ffc0ee5c:   4fef 000c   lea %sp@(12),%sp
ffc0ee60:   2d40 fff8   movel %d0,%fp@(-8)
ffc0ee64:   2d41 fffc   movel %d1,%fp@(-4)
ffc0ee68:   4e71nop

ffc0ee6a:   2843moveal %d3,%a4
ffc0ee6c:   202e fff8   movel %fp@(-8),%d0
ffc0ee70:   222e fffc   movel %fp@(-4),%d1
ffc0ee74:   2800movel %d0,%d4
ffc0ee76:   8881orl %d1,%d4
ffc0ee78:   670abeqs ffc0ee84 <print_size+0x56>
ffc0ee7a:   206d 03d0   moveal %a5@(976),%a0
ffc0ee7e:   1430 2800   moveb %a0@(,%d2:l),%d2

I don't see anything strange in the opcodes, anyway, execution stops somewhere
between the 2 nops.


[Bug c/64800] New: Bad opcode produced for coldfire mcf5307 processor

2015-01-26 Thread angelo70 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64800

Bug ID: 64800
   Summary: Bad opcode produced for coldfire mcf5307 processor
   Product: gcc
   Version: 4.6.3
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: angelo70 at gmail dot com

Dear all,

i am compiling a simple bare-metal binary with 

https://www.kernel.org/pub/tools/crosstool/files/bin/i686/4.6.3/i686-gcc-4.6.3-nolibc_m68k-linux.tar.gz


$ make -f makefile.release
/opt/toolchains/m68k/gcc-4.6.3-nolibc/m68k-linux/bin/m68k-linux-gcc -m5307 -g
-O2 -fno-builtin -I include -c -o obj/boot.o src/boot.S
/opt/toolchains/m68k/gcc-4.6.3-nolibc/m68k-linux/bin/m68k-linux-gcc -m5307 -g
-O2 -fno-builtin -I include -c -o obj/vt100.o src/vt100.c
/opt/toolchains/m68k/gcc-4.6.3-nolibc/m68k-linux/bin/m68k-linux-gcc -m5307 -g
-O2 -fno-builtin -I include -c -o obj/timing.o src/timing.c
/opt/toolchains/m68k/gcc-4.6.3-nolibc/m68k-linux/bin/m68k-linux-gcc -m5307 -g
-O2 -fno-builtin -I include -c -o obj/flash.o src/flash.c
/opt/toolchains/m68k/gcc-4.6.3-nolibc/m68k-linux/bin/m68k-linux-gcc -m5307 -g
-O2 -fno-builtin -I include -c -o obj/memory.o src/memory.c
/opt/toolchains/m68k/gcc-4.6.3-nolibc/m68k-linux/bin/m68k-linux-gcc -m5307 -g
-O2 -fno-builtin -I include -c -o obj/main.o src/main.c
/opt/toolchains/m68k/gcc-4.6.3-nolibc/m68k-linux/bin/m68k-linux-gcc -m5307 -g
-O2 -fno-builtin -I include -c -o obj/serial.o src/serial.c
/opt/toolchains/m68k/gcc-4.6.3-nolibc/m68k-linux/bin/m68k-linux-ld -T ram.ld -M
-o bin/cf4k.elf obj/boot.o obj/vt100.o obj/timing.o obj/flash.o obj/memory.o
obj/main.o obj/serial.o  bin/cf4k.map
/opt/toolchains/m68k/gcc-4.6.3-nolibc/m68k-linux/bin/m68k-linux-objcopy -O
binary bin/cf4k.elf bin/cf4k

The resulting opcodes seems not correct for mcf5307 (coldfire).
Wrong code is of course not running on the target board. 

See this meminit func disass:

Dump of assembler code for function meminit:
   0x2758 +0: linkw %fp,#-12
   0x275c +4: moveml %a2-%a4,%sp@
   0x2760 +8: movel #262144,%sp@-
   0x2766 +14:lea 0x24fc delay,%a3
   0x276c +20:moveal #268435720,%a2
   0x2772 +26:moveaw #4,%a4
   0x2776 +30:jsr %a3@
   0x2778 +32:movew #-32218,%d0
   0x277c +36:movew %d0,0x1100
   0x2782 +42:movel #16711681,%d0
   0x2788 +48:movel #13060,%a2@
   0x278e +54:movel %d0,0x110c
= 0x2794 +60:movel #13068,%a2@
   0x279a +66:movel #-1095901459,%a4@
   0x27a0 +72:movel #45828,%a2@
   0x27a6 +78:pea 0x68a
   0x27aa +82:jsr %a3@
   0x27ac +84:movel #-1095901459,%a4@
   0x27b2 +90:movel #45828,%a2@
   0x27b8 +96:movel #262144,%sp@-
   0x27be +102:   jsr %a3@
   0x27c0 +104:   movel #-1095901459,%d0
   0x27c6 +110:   lea %sp@(12),%sp
   0x27ca +114:   movel #45892,%a2@
   0x27d0 +120:   movel %d0,0xc00
   0x27d4 +124:   moveq #4,%d0
   0x27d6 +126:   swap %d0
   0x27d8 +128:   .short 0x4cfe 
   0x27da +130:   moveb %d0,%d6 
   0x27dc +132:   .short 0xfff4 
   0x27de +134:   unlk %fp
   0x27e0 +136:   movel %d0,0x1114
   0x27e6 +142:   clrl 0x1110
   0x27ec +148:   rts

While, with a toolchain from CodeSourcery, 

 /opt/toolchains/m68k/Sourcery_CodeBench_Lite_for_ColdFire_ELF/bin/m68k-elf-gcc
--version
m68k-elf-gcc (Sourcery CodeBench Lite 2011.09-21) 4.6.1
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


i get

= 0x2758 +0: linkw %fp,#-12
   0x275c +4: moveml %a2-%a4,%sp@
   0x2760 +8: movel #262144,%sp@-
   0x2766 +14:lea 0x24f8 delay,%a3
   0x276c +20:moveal #268435720,%a2
   0x2772 +26:moveaw #4,%a4
   0x2776 +30:jsr %a3@
   0x2778 +32:movew #-32218,%d0
   0x277c +36:movew %d0,0x1100
   0x2782 +42:movel #16711681,%d0
   0x2788 +48:movel #13060,%a2@
   0x278e +54:movel %d0,0x110c
   0x2794 +60:movel #13068,%a2@
   0x279a +66:movel #-1095901459,%a4@
   0x27a0 +72:movel #45828,%a2@
   0x27a6 +78:pea 0x68a
   0x27aa +82:jsr %a3@
   0x27ac +84:movel #-1095901459,%a4@
   0x27b2 +90:movel #45828,%a2@
   0x27b8 +96:movel #262144,%sp@-
   0x27be +102:   jsr %a3@
   0x27c0 +104:   movel #-1095901459,%d0
   0x27c6 +110:   lea %sp@(12),%sp
   0x27ca +114:   movel #45892,%a2@
   0x27d0 +120:   movel %d0,0xc00
   0x27d4 +124:   moveq #4,%d0
   0x27d6 +126:   swap %d0
   0x27d8 +128:   moveml %fp@(-12),%a2-%a4
   0x27de +134:   unlk %fp
   0x27e0 +136:   movel %d0,0x1114
   0x27e6 +142:   clrl 0x1110

[Bug c/64800] Bad opcode produced for coldfire mcf5307 processor

2015-01-26 Thread angelo70 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64800

--- Comment #2 from angelo angelo70 at gmail dot com ---

You mean the issue is into m68k-linux-as or what ?

The function i disassembled is inside memory.c. So i am calling m68k-linux-gcc,
wich generate object code and finally opcodes.


[Bug target/62663] m68k / coldfire : compiling with -msep-data breaks the code

2014-09-02 Thread angelo70 at gmail dot com
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 0x7000, that's a completely invalid
address.


[Bug c/62663] New: m68k / coldfire : compiling with -msep-data breaks the code

2014-09-01 Thread angelo70 at gmail dot com
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=33430action=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=0xffc0 -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.


[Bug c/62663] m68k / coldfire : compiling with -msep-data breaks the code

2014-09-01 Thread angelo70 at gmail dot com
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=33431action=edit
wrong object