Commit c18605cc by Andreas Krebbel Committed by Andreas Krebbel

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
parent 6d105d8d
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> 2010-09-06 Richard Guenther <rguenther@suse.de>
* tree.def (MISALIGNED_INDIRECT_REF): Remove. * 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) ...@@ -3138,7 +3138,7 @@ try_combine (rtx i3, rtx i2, rtx i1, rtx i0, int *new_direct_jump_p)
} }
n_occurrences = 0; n_occurrences = 0;
subst_low_luid = DF_INSN_LUID (i1); subst_low_luid = DF_INSN_LUID (i0);
newpat = subst (newpat, i0dest, i0src, 0, newpat = subst (newpat, i0dest, i0src, 0,
i0_feeds_i1_n && i0dest_in_i0src); i0_feeds_i1_n && i0dest_in_i0src);
substed_i0 = 1; substed_i0 = 1;
......
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> 2010-09-06 Jakub Jelinek <jakub@redhat.com>
PR testsuite/45543 PR testsuite/45543
......
/* { 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment