mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-23 14:31:26 +08:00
re PR target/65647 (GCC won't stop when compile for armv6-m)
2015-04-04 Vladimir Makarov <vmakarov@redhat.com> PR target/65647 * lra-int.h (LRA_MAX_REMATERIALIZATION_PASSES): New. Add its value checking. (lra_rematerialization_iter): New. * lra.c (lra): Initialize lra_rematerialization_iter. Stop updating lra_constraint_new_regno_start after switching of inheritance and rematerialization. * lra-remat.c (lra_rematerialization_iter): New. (lra_remat): Add printing pass iteration. Do rematerialization only first LRA_MAX_REMATERIALIZATION_PASSES iterations. 2015-04-04 Vladimir Makarov <vmakarov@redhat.com> PR target/65647 * gcc.target/arm/pr65647.c: New. From-SVN: r221867
This commit is contained in:
parent
30c5a937e1
commit
9444692807
@ -1,3 +1,16 @@
|
||||
2015-04-04 Vladimir Makarov <vmakarov@redhat.com>
|
||||
|
||||
PR target/65647
|
||||
* lra-int.h (LRA_MAX_REMATERIALIZATION_PASSES): New. Add its
|
||||
value checking.
|
||||
(lra_rematerialization_iter): New.
|
||||
* lra.c (lra): Initialize lra_rematerialization_iter.
|
||||
Stop updating lra_constraint_new_regno_start after switching of
|
||||
inheritance and rematerialization.
|
||||
* lra-remat.c (lra_rematerialization_iter): New.
|
||||
(lra_remat): Add printing pass iteration. Do rematerialization
|
||||
only first LRA_MAX_REMATERIALIZATION_PASSES iterations.
|
||||
|
||||
2015-04-04 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/64909
|
||||
|
@ -271,6 +271,14 @@ typedef struct lra_insn_recog_data *lra_insn_recog_data_t;
|
||||
#error wrong LRA_MAX_INHERITANCE_PASSES value
|
||||
#endif
|
||||
|
||||
/* Analogous macro to the above one but for rematerialization. */
|
||||
#define LRA_MAX_REMATERIALIZATION_PASSES 2
|
||||
|
||||
#if LRA_MAX_REMATERIALIZATION_PASSES <= 0 \
|
||||
|| LRA_MAX_REMATERIALIZATION_PASSES >= LRA_MAX_ASSIGNMENT_ITERATION_NUMBER - 8
|
||||
#error wrong LRA_MAX_REMATERIALIZATION_PASSES value
|
||||
#endif
|
||||
|
||||
/* lra.c: */
|
||||
|
||||
extern FILE *lra_dump_file;
|
||||
@ -392,6 +400,7 @@ extern void lra_final_code_change (void);
|
||||
|
||||
/* lra-remat.c: */
|
||||
|
||||
extern int lra_rematerialization_iter;
|
||||
extern bool lra_remat (void);
|
||||
|
||||
/* lra-elimination.c: */
|
||||
|
@ -1259,6 +1259,9 @@ do_remat (void)
|
||||
|
||||
|
||||
|
||||
/* Current number of rematerialization iteration. */
|
||||
int lra_rematerialization_iter;
|
||||
|
||||
/* Entry point of the rematerialization sub-pass. Return true if we
|
||||
did any rematerialization. */
|
||||
bool
|
||||
@ -1270,6 +1273,13 @@ lra_remat (void)
|
||||
|
||||
if (! flag_lra_remat)
|
||||
return false;
|
||||
lra_rematerialization_iter++;
|
||||
if (lra_rematerialization_iter > LRA_MAX_REMATERIALIZATION_PASSES)
|
||||
return false;
|
||||
if (lra_dump_file != NULL)
|
||||
fprintf (lra_dump_file,
|
||||
"\n******** Rematerialization #%d: ********\n\n",
|
||||
lra_rematerialization_iter);
|
||||
timevar_push (TV_LRA_REMAT);
|
||||
insn_to_cand = XCNEWVEC (cand_t, get_max_uid ());
|
||||
regno_cands = XCNEWVEC (cand_t, max_regno);
|
||||
|
@ -2260,6 +2260,7 @@ lra (FILE *f)
|
||||
lra_live_range_iter = lra_coalesce_iter = lra_constraint_iter = 0;
|
||||
lra_assignment_iter = lra_assignment_iter_after_spill = 0;
|
||||
lra_inheritance_iter = lra_undo_inheritance_iter = 0;
|
||||
lra_rematerialization_iter = 0;
|
||||
|
||||
setup_reg_spill_flag ();
|
||||
|
||||
@ -2405,7 +2406,12 @@ lra (FILE *f)
|
||||
/* Assignment of stack slots changes elimination offsets for
|
||||
some eliminations. So update the offsets here. */
|
||||
lra_eliminate (false, false);
|
||||
lra_constraint_new_regno_start = max_reg_num ();
|
||||
/* After switching off inheritance and rematerialization passes,
|
||||
don't forget reload pseudos after spilling sub-pass to avoid
|
||||
LRA cycling in some complicated cases. */
|
||||
if (lra_inheritance_iter <= LRA_MAX_INHERITANCE_PASSES
|
||||
|| lra_rematerialization_iter <= LRA_MAX_REMATERIALIZATION_PASSES)
|
||||
lra_constraint_new_regno_start = max_reg_num ();
|
||||
lra_assignment_iter_after_spill = 0;
|
||||
}
|
||||
restore_scratches ();
|
||||
|
@ -1,3 +1,8 @@
|
||||
2015-04-04 Vladimir Makarov <vmakarov@redhat.com>
|
||||
|
||||
PR target/65647
|
||||
* gcc.target/arm/pr65647.c: New.
|
||||
|
||||
2015-04-03 Jan Hubicka <hubicka@ucw.cz>
|
||||
|
||||
PR ipa/65655
|
||||
|
58
gcc/testsuite/gcc.target/arm/pr65647.c
Normal file
58
gcc/testsuite/gcc.target/arm/pr65647.c
Normal file
@ -0,0 +1,58 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-march=armv6-m -mthumb -O3 -w" } */
|
||||
|
||||
a, b, c, e, g = &e, h, i = 7, l = 1, m, n, o, q = &m, r, s = &r, u, w = 9, x,
|
||||
y = 6, z, t6 = 7, t8, t9 = 1, t11 = 5, t12 = &t8, t13 = 3, t15,
|
||||
t16 = &t15;
|
||||
struct {
|
||||
long long f3;
|
||||
char f4
|
||||
} p = {3}
|
||||
|
||||
,
|
||||
t = {4};
|
||||
|
||||
struct S1 {
|
||||
long long f0;
|
||||
short f1;
|
||||
long long f2
|
||||
} d;
|
||||
long long f = 4073709551613, t7 = 8, t14 = 4073709551610;
|
||||
j[];
|
||||
k = j;
|
||||
v = &d;
|
||||
*t10 = j;
|
||||
struct S1 fn1();
|
||||
struct S1 fn2() {
|
||||
signed char t1;
|
||||
struct S1 t2;
|
||||
long t3 = x;
|
||||
short t4 = h;
|
||||
short *t5 = &l;
|
||||
fn1(t2, w, 1, o);
|
||||
if (u) {
|
||||
l = q;
|
||||
t1 = a < b ?: b;
|
||||
z = c >= 2 || t1 << c;
|
||||
}
|
||||
*t5 = t4 &= t3;
|
||||
fn3(y);
|
||||
}
|
||||
|
||||
fn4() {
|
||||
t6 = t.f3;
|
||||
fn5(k, t7);
|
||||
}
|
||||
|
||||
struct S1 fn1() {
|
||||
f = 0;
|
||||
for (; i;)
|
||||
;
|
||||
t11 = 0;
|
||||
t13 = *t10 = t14 || n;
|
||||
t9 = t12;
|
||||
for (; p.f4;)
|
||||
s = t16 <= fn6();
|
||||
if (g)
|
||||
v = 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user