mirror of git://gcc.gnu.org/git/gcc.git
combine.c (try_combine): Set subst_low_luid to i0.
2010-09-06 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> * combine.c (try_combine): Set subst_low_luid to i0. 2010-09-06 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> * gcc.dg/20100906-1.c: New testcase. From-SVN: r163917
This commit is contained in:
parent
6d105d8db8
commit
c18605ccec
|
@ -1,3 +1,7 @@
|
|||
2010-09-06 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
|
||||
|
||||
* combine.c (try_combine): Set subst_low_luid to i0.
|
||||
|
||||
2010-09-06 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
* tree.def (MISALIGNED_INDIRECT_REF): Remove.
|
||||
|
|
|
@ -3138,7 +3138,7 @@ try_combine (rtx i3, rtx i2, rtx i1, rtx i0, int *new_direct_jump_p)
|
|||
}
|
||||
|
||||
n_occurrences = 0;
|
||||
subst_low_luid = DF_INSN_LUID (i1);
|
||||
subst_low_luid = DF_INSN_LUID (i0);
|
||||
newpat = subst (newpat, i0dest, i0src, 0,
|
||||
i0_feeds_i1_n && i0dest_in_i0src);
|
||||
substed_i0 = 1;
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2010-09-06 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
|
||||
|
||||
* gcc.dg/20100906-1.c: New testcase.
|
||||
|
||||
2010-09-06 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR testsuite/45543
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
/* { dg-do run } */
|
||||
/* { dg-options "-O2" } */
|
||||
|
||||
/* This testcase got misoptimized by combine due to a wrong setting of
|
||||
subst_low_luid in try_combine. */
|
||||
|
||||
enum rtx_code {
|
||||
A, B
|
||||
};
|
||||
|
||||
void abort (void);
|
||||
|
||||
struct rtx_def {
|
||||
__extension__ enum rtx_code code:16;
|
||||
};
|
||||
typedef struct rtx_def *rtx;
|
||||
|
||||
void __attribute__((noinline))
|
||||
add_constraint (unsigned char is_a)
|
||||
{
|
||||
if (is_a)
|
||||
abort ();
|
||||
}
|
||||
|
||||
void __attribute__((noinline))
|
||||
foo (rtx defn)
|
||||
{
|
||||
switch (defn->code)
|
||||
{
|
||||
case A:
|
||||
case B:
|
||||
add_constraint (defn->code == A);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
struct rtx_def r;
|
||||
|
||||
r.code = B;
|
||||
|
||||
foo (&r);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue