[Bug rtl-optimization/96475] direct threaded interpreter with computed gotos generates suboptimal dispatch loop

2020-09-14 Thread dinuxbg at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96475

--- Comment #23 from Dimitar Dimitrov  ---
(In reply to Segher Boessenkool from comment #20)
> Could you guys please test the attached patch?  Thanks in advance!

Yes, it fixed all new regressions for pru-elf. Thanks.

[Bug rtl-optimization/96475] direct threaded interpreter with computed gotos generates suboptimal dispatch loop

2020-09-12 Thread dinuxbg at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96475

Dimitar Dimitrov  changed:

   What|Removed |Added

 CC||dinuxbg at gmail dot com

--- Comment #16 from Dimitar Dimitrov  ---
Patch is also causing ICE in a few test cases on pru-elf target:

during RTL pass: ce3
/home/dinux/projects/pru/testbot-workspace/gcc/gcc/testsuite/gcc.c-torture/compile/pr46107.c:
In function 'bar':
/home/dinux/projects/pru/testbot-workspace/gcc/gcc/testsuite/gcc.c-torture/compile/pr46107.c:18:1:
internal compiler error: in calc_dfs_tree, at dominance.c:458
0x598a77 calc_dfs_tree
/home/dinux/projects/pru/testbot-workspace/gcc/gcc/dominance.c:458
0x96f509 calculate_dominance_info(cdi_direction)
/home/dinux/projects/pru/testbot-workspace/gcc/gcc/dominance.c:734
0x90d292 flow_loops_find(loops*)
/home/dinux/projects/pru/testbot-workspace/gcc/gcc/cfgloop.c:431
0xbb39ce loop_optimizer_init(unsigned int)
/home/dinux/projects/pru/testbot-workspace/gcc/gcc/loop-init.c:93
0x1453d90 if_convert
/home/dinux/projects/pru/testbot-workspace/gcc/gcc/ifcvt.c:5382
0x14562fd execute
/home/dinux/projects/pru/testbot-workspace/gcc/gcc/ifcvt.c:5566

[Bug c/88966] Indirect stringification of "linux" produces "1"

2019-01-21 Thread dinuxbg at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88966

Dimitar Dimitrov  changed:

   What|Removed |Added

 CC||dinuxbg at gmail dot com

--- Comment #1 from Dimitar Dimitrov  ---
The "linux" is a predefined macro:

$ $ gcc -E -dM - 

[Bug tree-optimization/88753] [9 Regression] Wrong code since r265463 in tree switch conversion

2019-01-21 Thread dinuxbg at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88753

Dimitar Dimitrov  changed:

   What|Removed |Added

 CC||dinuxbg at gmail dot com

--- Comment #7 from Dimitar Dimitrov  ---
*** Bug 88609 has been marked as a duplicate of this bug. ***

[Bug target/88609] [avr] ice: insn does not satisfy its constraints while building libgcc

2019-01-21 Thread dinuxbg at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88609

Dimitar Dimitrov  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #2 from Dimitar Dimitrov  ---
Not an avr backend issue, but rather due to PR88753 bug in the host toolchain.

*** This bug has been marked as a duplicate of bug 88753 ***

[Bug target/88609] [avr] ice: insn does not satisfy its constraints while building libgcc

2019-01-02 Thread dinuxbg at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88609

--- Comment #1 from Dimitar Dimitrov  ---
Note that this build error depends on the host compiler used to build the avr
toolchain.

I can build successfully with host: gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516

Build fails with host top-of-tree build: gcc (GCC) 9.0.0 20181215
(experimental)

[Bug target/88609] New: [avr] ice: insn does not satisfy its constraints while building libgcc

2018-12-27 Thread dinuxbg at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88609

Bug ID: 88609
   Summary: [avr] ice: insn does not satisfy its constraints while
building libgcc
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dinuxbg at gmail dot com
CC: avr at gjlay dot de, chertykov at gmail dot com
  Target Milestone: ---
  Host: x86_64
Target: avr
 Build: x86_64

I noticed that libgcc for avr in current master (r267421) cannot be built due
to internal compiler error.

$ /home/dinux/projects/avr/testbot-workspace/gcc-build/./gcc/xgcc
-B/home/dinux/projects/avr/testbot-workspace/gcc-build/./gcc/
-B/home/dinux/projects/avr/testbot-workspace/opt/avr/bin/
-B/home/dinux/projects/avr/testbot-workspace/opt/avr/lib/ -isystem
/home/dinux/projects/avr/testbot-workspace/opt/avr/include -isystem
/home/dinux/projects/avr/testbot-workspace/opt/avr/sys-include-g -O2
-mmcu=avr25 -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   -DDF=SF
-Dinhibit_libc -mcall-prologues -Os -g -DIN_LIBGCC2 -fbuilding-libgcc
-fno-stack-protector -Dinhibit_libc  -DDF=SF -Dinhibit_libc -mcall-prologues
-Os -I. -I. -I../../.././gcc
-I/home/dinux/projects/avr/testbot-workspace/gcc/libgcc
-I/home/dinux/projects/avr/testbot-workspace/gcc/libgcc/.
-I/home/dinux/projects/avr/testbot-workspace/gcc/libgcc/../gcc
-I/home/dinux/projects/avr/testbot-workspace/gcc/libgcc/../include 
-DHAVE_CC_TLS -DUSE_EMUTLS -o _divsc3.o -MT _divsc3.o -MD -MP -MF _divsc3.dep
-DL_divsc3 -c /home/dinux/projects/avr/testbot-workspace/gcc/libgcc/libgcc2.c
-fvisibility=hidden -DHIDE_EXPORTS
/home/dinux/projects/avr/testbot-workspace/gcc/libgcc/libgcc2.c: In function
'__divsc3':
/home/dinux/projects/avr/testbot-workspace/gcc/libgcc/libgcc2.c:2089:1: error:
insn does not satisfy its constraints:
 2089 | }
  | ^
(jump_insn 1579 17 23 2 (set (pc)
(if_then_else (eq (zero_extract:HI (reg:QI 24 r24 [205])
(const_int 1 [0x1])
(const_int 7 [0x7]))
(const_int 0 [0]))
(label_ref 675)
(pc)))
"/home/dinux/projects/avr/testbot-workspace/gcc/libgcc/libgcc2.c":2046:6 154
{*addsi3.lt0}
 (nil)
 -> 675)
during RTL pass: cprop_hardreg
/home/dinux/projects/avr/testbot-workspace/gcc/libgcc/libgcc2.c:2089:1:
internal compiler error: in extract_constrain_insn, at recog.c:2206
0x5f31ab _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/home/dinux/projects/avr/testbot-workspace/gcc/gcc/rtl-error.c:108
0x5f31d1 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/home/dinux/projects/avr/testbot-workspace/gcc/gcc/rtl-error.c:118
0x5f18db extract_constrain_insn(rtx_insn*)
/home/dinux/projects/avr/testbot-workspace/gcc/gcc/recog.c:2206
0xbb6000 copyprop_hardreg_forward_1
/home/dinux/projects/avr/testbot-workspace/gcc/gcc/regcprop.c:801
0xbb6d4c execute
/home/dinux/projects/avr/testbot-workspace/gcc/gcc/regcprop.c:1307


Here is the script I'm using to build the avr toolchain:
https://github.com/dinuxbg/gnupru/blob/master/testing/buildbot-avr.sh

The gcc config line I've used: 
   --target=avr --enable-languages=c,c++ --disable-nls --disable-libssp
--with-dwarf2

[Bug inline-asm/52813] %rsp in clobber list is silently ignored

2018-12-09 Thread dinuxbg at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52813

Dimitar Dimitrov  changed:

   What|Removed |Added

 CC||dinuxbg at gmail dot com

--- Comment #7 from Dimitar Dimitrov  ---
Suggested fix has been posted for review:
https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00532.html

[Bug testsuite/64430] Out-of-bounds array access in isl-ast-gen-if-1.c

2015-08-31 Thread dinuxbg at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64430

Dimitar Dimitrov  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #1 from Dimitar Dimitrov  ---
Fixed with:
* gcc.dg/graphite/isl-ast-gen-if.c (main): Increase size of a
array to allow a[50] to be a valid location.


[Bug testsuite/64430] New: Out-of-bounds array access in isl-ast-gen-if-1.c

2014-12-28 Thread dinuxbg at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64430

Bug ID: 64430
   Summary: Out-of-bounds array access in isl-ast-gen-if-1.c
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Severity: minor
  Priority: P3
 Component: testsuite
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dinuxbg at gmail dot com

In gcc.dg/graphite/isl-ast-gen-if-1.c:13 the following line has out-of-bounds
array access:
a[n - i] = 1;  //out-of-bounds when n=50 and i=0

Example fix:

--- a/gcc/testsuite/gcc.dg/graphite/isl-ast-gen-if-1.c
+++ b/gcc/testsuite/gcc.dg/graphite/isl-ast-gen-if-1.c
@@ -29,7 +29,7 @@ int
 main (void)
 {
   int a[50];
-  foo (a, 50);
+  foo (a, 49);


[Bug target/61044] New: Computed goto on AVR fails to use word-addressing

2014-05-03 Thread dinuxbg at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61044

Bug ID: 61044
   Summary: Computed goto on AVR fails to use word-addressing
   Product: gcc
   Version: 4.8.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dinuxbg at gmail dot com

Created attachment 32727
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=32727action=edit
Failed computed goto C example

The computed goto example taken straight from the GCC manual generates
incorrect code for AVR. When doing pointer arithmetic, the compiler fails to
mark labels with gs.

The following snippet from the attached test_fail C function:
static const int array[] = { foo - foo, bar - foo, hack - foo
};
will generate the following rodata:
array.1464:
.word   0
.word   .L3-(.L2)
.word   .L4-(.L2)


Note that straight labels without arithmetics work just fine (see test_good in
attached cg.c):
array.1472:
.word   gs(.L2)
.word   gs(.L3)
.word   gs(.L4)

I've tested with avr-gcc 4.8.2 from debian sid. But I believe bug is also
present in top of tree.


[Bug target/61044] Computed goto on AVR fails to use word-addressing

2014-05-03 Thread dinuxbg at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61044

--- Comment #1 from Dimitar Dimitrov dinuxbg at gmail dot com ---
The unofficial PRU GCC port (https://github.com/dinuxbg/gnupru) has the same
bug. I haven't tested the following patch on AVR, but a similar change seems to
fix the issue for PRU:


--- a/gcc/config/avr/predicates.md
+++ b/gcc/config/avr/predicates.md
@@ -122,7 +122,7 @@
-  (match_code code_label,label_ref,symbol_ref,plus,const)
+  (match_code code_label,label_ref,symbol_ref,plus,minus,const)
@@ -133,6 +133,7 @@
 case SYMBOL_REF :
   return SYMBOL_REF_FUNCTION_P (op);
 case PLUS :
+case MINUS :