gcc/gcc/config/arc
Andrew Burgess dd3d6a42fc arc: Fix for loop end detection
We use a negative ID number to link together the doloop_begin and
doloop_end instructions.  This negative ID number is setup within
doloop_begin, at this point the ID is stored into the loop end
instruction (doloop_end_i) and placed into the doloop_begin_i
instruction.

In arc.c (arc_reorg) we extract the ID from the doloop_end_i
instruction in order to find the matching doloop_begin_i instruction,
though the ID is only used in some cases.

Currently in arc_reorg when we extract the ID we negate it.  This
negation is invalid.  The ID stored in both doloop_end_i and
doloop_begin_i is already negative, the negation in arc_reorg means
that if we need to use the ID to find the doloop_begin_i then we will
never find it (as the IDs will never match).

This commit removes the unneeded negation, moves the extraction of the
ID into a more appropriately scoped block and adds a new test for this
issue.

gcc/ChangeLog:

	* config/arc/arc.c (arc_reorg): Move loop_end_id into a more local
	block, and do not negate it, the stored id is already negative.

gcc/testsuite/ChangeLog:

	* gcc.target/arc/loop-1.c: New file.


Co-Authored-By: Guy Benyei <guybe@mellanox.com>

From-SVN: r246933
2017-04-14 22:14:34 +01:00
..
arc-arch.h gcc/arc: Make arc_selected_cpu global 2017-02-09 00:34:00 +00:00
arc-arches.def Update copyright years. 2017-01-01 13:07:43 +01:00
arc-c.c Update copyright years. 2017-01-01 13:07:43 +01:00
arc-c.def arc/gcc: Better creation of __NPS400__ define 2017-02-09 00:35:20 +00:00
arc-cpus.def Update copyright years. 2017-01-01 13:07:43 +01:00
arc-modes.def Update copyright years. 2017-01-01 13:07:43 +01:00
arc-options.def Update copyright years. 2017-01-01 13:07:43 +01:00
arc-opts.h Update copyright years. 2017-01-01 13:07:43 +01:00
arc-protos.h [ARC] DWARF emitting cleanup. 2017-04-14 13:40:54 +02:00
arc-simd.h Update copyright years. 2017-01-01 13:07:43 +01:00
arc-tables.opt Update copyright years. 2017-01-01 13:07:43 +01:00
arc.c arc: Fix for loop end detection 2017-04-14 22:14:34 +01:00
arc.h [ARC] Use long jumps for CRT calls 2017-04-14 13:41:04 +02:00
arc.md arc: Use @pcl assembler syntax instead of invalid expressions 2017-04-14 22:08:35 +01:00
arc.opt [ARC] Disable TP register when building for bare metal. 2017-03-27 12:56:24 +02:00
arc600.md Update copyright years. 2017-01-01 13:07:43 +01:00
arc700.md Update copyright years. 2017-01-01 13:07:43 +01:00
arcEM.md Update copyright years. 2017-01-01 13:07:43 +01:00
arcHS.md Update copyright years. 2017-01-01 13:07:43 +01:00
atomic.md Update copyright years. 2017-01-01 13:07:43 +01:00
big.h [ARC] Clean up arc header file. 2017-02-27 14:56:02 +01:00
builtins.def Update copyright years. 2017-01-01 13:07:43 +01:00
constraints.md Update copyright years. 2017-01-01 13:07:43 +01:00
driver-arc.c gcc/arc: Make arc_selected_cpu global 2017-02-09 00:34:00 +00:00
elf.h [ARC] Define _REENTRANT when -pthread is passed. 2017-03-28 10:56:44 +02:00
fpu.md [ARC] Add support for QuarkSE processor. 2016-11-17 14:43:32 +01:00
fpx.md Update copyright years. 2017-01-01 13:07:43 +01:00
genmultilib.awk Update copyright years. 2017-01-01 13:07:43 +01:00
genoptions.awk Update copyright years. 2017-01-01 13:07:43 +01:00
linux.h [ARC] Define _REENTRANT when -pthread is passed. 2017-03-28 10:56:44 +02:00
predicates.md [ARC] Fix move_double_src_operand predicate. 2017-03-27 12:56:46 +02:00
simdext.md [ARC] Update ARC SIMD patterns. 2017-03-28 10:56:33 +02:00
t-arc Update copyright years. 2017-01-01 13:07:43 +01:00
t-multilib Update copyright years. 2017-01-01 13:07:43 +01:00