* [PATCH] Fix PR46216
@ 2010-11-02 17:08 Richard Guenther
0 siblings, 0 replies; only message in thread
From: Richard Guenther @ 2010-11-02 17:08 UTC (permalink / raw)
To: gcc-patches
Bootstrapped and teste don x86_64-unknwon-linxug-nu, applied.
RIchard.
2010-11-02 Richard Guenther <rguenther@suse.de>
PR tree-optimization/46216
* tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_vars):
Check if we can propagate from a POINTER_PLUS_EXPR before doing so.
* gcc.dg/torture/pr46216.c: New testcase.
Index: gcc/tree-ssa-forwprop.c
===================================================================
*** gcc/tree-ssa-forwprop.c (revision 166172)
--- gcc/tree-ssa-forwprop.c (working copy)
*************** tree_ssa_forward_propagate_single_use_va
*** 1983,1989 ****
else
gsi_next (&gsi);
}
! else if (gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR)
{
if (TREE_CODE (gimple_assign_rhs2 (stmt)) == INTEGER_CST
/* ??? Better adjust the interface to that function
--- 1983,1990 ----
else
gsi_next (&gsi);
}
! else if (gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR
! && can_propagate_from (stmt))
{
if (TREE_CODE (gimple_assign_rhs2 (stmt)) == INTEGER_CST
/* ??? Better adjust the interface to that function
Index: gcc/testsuite/gcc.dg/torture/pr46216.c
===================================================================
*** gcc/testsuite/gcc.dg/torture/pr46216.c (revision 0)
--- gcc/testsuite/gcc.dg/torture/pr46216.c (revision 0)
***************
*** 0 ****
--- 1,24 ----
+ /* { dg-do compile } */
+
+ typedef int Embryo_Cell;
+ int
+ embryo_program_run(Embryo_Cell *cip)
+ {
+ unsigned char op;
+ Embryo_Cell offs;
+ static const void *switchtable[256] = {
+ &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_LOAD_PRI
+ };
+ for (;;)
+ {
+ op = *cip++;
+ while (1) {
+ goto *switchtable[op];
+ SWITCHTABLE_EMBRYO_OP_LOAD_PRI:
+ offs = *(Embryo_Cell *)cip++;
+ SWITCHTABLE_EMBRYO_OP_NONE:
+ break;
+ };
+ }
+ return offs;
+ }
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-11-02 16:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-02 17:08 [PATCH] Fix PR46216 Richard Guenther
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).