[Bug target/54049] cr16: ICE: in gen_rtx_SUBREG with -O1

2012-08-13 Thread stefan at astylos dot dk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54049

Stefan Sørensen  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED

--- Comment #1 from Stefan Sørensen  2012-08-13 
10:51:19 UTC ---
Works in 4.8-20120812 snapshot, closing.


[Bug target/57636] New: cr16: ICE while building libgcc

2013-06-17 Thread stefan at astylos dot dk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57636

Bug ID: 57636
   Summary: cr16: ICE while building libgcc
   Product: gcc
   Version: 4.8.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: stefan at astylos dot dk
Target: cr16-none-elf

# ./configure --target cr16-none-elf
# make all-gcc all-target-libgcc'
...
make[4]: Entering directory
`/home/ssorensen/sources/gcc-build/cr16-none-elf/far-pic/libgcc'
# If this is the top-level multilib, build all the other
# multilibs.
/home/ssorensen/sources/gcc-build/./gcc/xgcc
-B/home/ssorensen/sources/gcc-build/./gcc/ -B/usr/local/cr16-none-elf/bin/
-B/usr/local/cr16-none-elf/lib/ -isystem /usr/local/cr16-none-elf/include
-isystem /usr/local/cr16-none-elf/sys-include-g -O2 -fPIC -mcr16cplus
-mdata-model=far -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   -g
-DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc  -I. -I.
-I../../.././gcc -I../../../../gcc/libgcc -I../../../../gcc/libgcc/.
-I../../../../gcc/libgcc/../gcc -I../../../../gcc/libgcc/../include 
-DHAVE_CC_TLS -DUSE_EMUTLS -o _udivmoddi4.o -MT _udivmoddi4.o -MD -MP -MF
_udivmoddi4.dep -DL_udivmoddi4 -c ../../../../gcc/libgcc/libgcc2.c \
  -fexceptions -fnon-call-exceptions -fvisibility=hidden -DHIDE_EXPORTS
../../../../gcc/libgcc/libgcc2.c: In function ‘__udivmoddi4’:
../../../../gcc/libgcc/libgcc2.c:1112:1: internal compiler error: in
variable_post_merge_new_vals, at var-tracking.c:4430
 }
 ^
0x8d514b variable_post_merge_new_vals
../../gcc/gcc/var-tracking.c:4428
0x9e5cf7 htab_traverse_noresize
../../gcc/libiberty/hashtab.c:784
0x8d8511 dataflow_post_merge_adjust
../../gcc/gcc/var-tracking.c:4540
0x8d8511 vt_find_locations
../../gcc/gcc/var-tracking.c:6965
0x8de854 variable_tracking_main_1
../../gcc/gcc/var-tracking.c:10166
0x8de854 variable_tracking_main()
../../gcc/gcc/var-tracking.c:10212

Removing either the -g or the -O2 from the compile command avoids the ICE.

It was introduced in trunk@188870:
2012-06-21  Alexandre Oliva  

PR debug/53671
PR debug/49888
* var-tracking.c (vt_initialize): Record initial offset between
arg pointer and stack pointer.

[Bug target/57636] cr16: ICE while building libgcc

2013-06-18 Thread stefan at astylos dot dk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57636

--- Comment #1 from Stefan Sørensen  ---
Created attachment 30318
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30318&action=edit
Simple testcase that triggers the ICE when built with -Os -g

[Bug target/54049] New: cr16: ICE: in gen_rtx_SUBREG with -O1

2012-07-20 Thread stefan at astylos dot dk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54049

 Bug #: 54049
   Summary: cr16: ICE: in gen_rtx_SUBREG with -O1
Classification: Unclassified
   Product: gcc
   Version: 4.7.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: ste...@astylos.dk
Target: cr16-none-elf


Created attachment 27845
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27845
Minimized testcase

# cr16-none-elf-gcc -v -O1 -c cr16-o1-ice.c
Using built-in specs.
COLLECT_GCC=cr16-none-elf-gcc
Target: cr16-none-elf
Configured with: ../gcc-4.7.1/configure --disable-dependency-tracking
--disable-silent-rules --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin
--sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share
--includedir=/usr/include --libexecdir=/usr/libexec --localstatedir=/var
--sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info
--build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu
--target=cr16-none-elf --enable-targets=all --program-prefix=cr16-none-elf-
--enable-languages=c --without-headers --enable-sjlj-exceptions
--with-system-libunwind --disable-nls --disable-threads --disable-shared
--disable-libmudflap --disable-libssp --disable-libgomp --disable-libquadmath
--disable-gold --disable-decimal-float --enable-checking=
--enable-gnu-unique-object --enable-linker-build-id --disable-plugin
--enable-nls --with-system-zlib
Thread model: single
gcc version 4.7.1 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-O1' '-c'
 /usr/libexec/gcc/cr16-none-elf/4.7.1/cc1 -quiet -v cr16-o1-ice.c -quiet
-dumpbase cr16-o1-ice.c -auxbase cr16-o1-ice -O1 -version -o /tmp/cckoKsDA.s
GNU C (GCC) version 4.7.1 (cr16-none-elf)
compiled by GNU C version 4.7.0 20120507 (Red Hat 4.7.0-5), GMP version
5.0.2, MPFR version 3.1.0, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/usr/lib/gcc/cr16-none-elf/4.7.1/../../../../cr16-none-elf/sys-include"
ignoring nonexistent directory
"/usr/lib/gcc/cr16-none-elf/4.7.1/../../../../cr16-none-elf/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/cr16-none-elf/4.7.1/include
 /usr/lib/gcc/cr16-none-elf/4.7.1/include-fixed
End of search list.
GNU C (GCC) version 4.7.1 (cr16-none-elf)
compiled by GNU C version 4.7.0 20120507 (Red Hat 4.7.0-5), GMP version
5.0.2, MPFR version 3.1.0, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 4e373966a7f913a5f46786a9aa6c7050
cr16-o1-ice.c: In function ‘f’:
cr16-o1-ice.c:14:1: internal compiler error: in gen_rtx_SUBREG, at
emit-rtl.c:769
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

# cat cr16-o1-ice.c
void f (void)
{
char buf[18];
unsigned i;
unsigned *r = 0;

for (i = 0; i < sizeof (buf); i++)
buf[i] = i;

while (1) {
for (i = 0; i < sizeof (buf); i++)
*r = buf[i];
}
}

Compiling without -O1 succeeds


[Bug target/61128] New: [cr16] Incorrect code generated for udivmodsi4

2014-05-09 Thread stefan at astylos dot dk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61128

Bug ID: 61128
   Summary: [cr16] Incorrect code generated for udivmodsi4
   Product: gcc
   Version: 4.10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: stefan at astylos dot dk
Target: cr16

Created attachment 32769
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32769&action=edit
Preprocessed source

When a cr16 crosscompiler builds gcc, the return sequence of udivmodsi4 looks
like this:
...
movwr2, r0
movwr3, r1
cmpw$0, r6
bne .L10
movwra, r0
movwra, r1
.L10:
pop $1, r7
popret  ra

The last two movw instructions tries to move the 32 bits in ra to the pair of
16 bit registers r0 and r1, but this will only move the low order 16 bits to
both of them. This should probably be a 'movd (ra),(r1,r0)' instruction
instead.

This is in 4.8, 4.9 and current trunk. 

Configuration options:
--target=cr16-none-elf --enable-languages=c --without-headers --disable-libssp