re PR tree-optimization/42705 (verify_flow_info failed with -O)

2010-01-13  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/42705
	* tree-ssa-reassoc.c (build_and_add_sum): Insert stmts after
	labels.

	* gcc.c-torture/compile/pr42705.c: New testcase.

From-SVN: r155861
This commit is contained in:
Richard Guenther 2010-01-13 15:04:38 +00:00 committed by Richard Biener
parent 9858e0ccda
commit 1d21a8e566
4 changed files with 72 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2010-01-13 Richard Guenther <rguenther@suse.de>
PR tree-optimization/42705
* tree-ssa-reassoc.c (build_and_add_sum): Insert stmts after
labels.
2010-01-13 Richard Guenther <rguenther@suse.de>
PR middle-end/42716

View File

@ -1,3 +1,8 @@
2010-01-13 Richard Guenther <rguenther@suse.de>
PR tree-optimization/42705
* gcc.c-torture/compile/pr42705.c: New testcase.
2010-01-13 Jie Zhang <jie.zhang@analog.com>
* gcc.target/bfin/l2.c: New test.

View File

@ -0,0 +1,58 @@
typedef int GLint;
typedef unsigned char GLubyte;
typedef unsigned int uint32_t;
struct radeon_bo {
void *ptr;
uint32_t flags;
};
struct radeon_renderbuffer {
struct radeon_bo *bo;
unsigned int cpp;
int has_surface;
};
static inline
GLint r600_1d_tile_helper(const struct radeon_renderbuffer * rrb,
GLint x, GLint y, GLint is_depth, GLint is_stencil)
{
GLint element_bytes = rrb->cpp;
GLint num_samples = 1;
GLint tile_width = 8;
GLint tile_height = 8;
GLint tile_thickness = 1;
GLint tile_bytes;
GLint tiles_per_row;
GLint slice_offset;
GLint tile_row_index;
GLint tile_column_index;
GLint tile_offset;
GLint pixel_number = 0;
GLint element_offset;
GLint offset = 0;
tile_bytes = tile_width * tile_height * tile_thickness
* element_bytes * num_samples;
tile_column_index = x / tile_width;
tile_offset = ((tile_row_index * tiles_per_row)
+ tile_column_index) * tile_bytes;
if (is_depth) {
}
else {
GLint sample_offset;
switch (element_bytes) {
case 1: pixel_number |= ((x >> 0) & 1) << 0;
}
element_offset = sample_offset + (pixel_number * element_bytes);
}
offset = slice_offset + tile_offset + element_offset;
return offset;
}
GLubyte *r600_ptr_color(const struct radeon_renderbuffer * rrb,
GLint x, GLint y)
{
GLubyte *ptr = rrb->bo->ptr;
uint32_t mask = 1 | 2;
GLint offset;
if (rrb->has_surface || !(rrb->bo->flags & mask)) {
offset = r600_1d_tile_helper(rrb, x, y, 0, 0);
}
return &ptr[offset];
}

View File

@ -845,7 +845,7 @@ build_and_add_sum (tree tmpvar, tree op1, tree op2, enum tree_code opcode)
if ((!op1def || gimple_nop_p (op1def))
&& (!op2def || gimple_nop_p (op2def)))
{
gsi = gsi_start_bb (single_succ (ENTRY_BLOCK_PTR));
gsi = gsi_after_labels (single_succ (ENTRY_BLOCK_PTR));
gsi_insert_before (&gsi, sum, GSI_NEW_STMT);
}
else if ((!op1def || gimple_nop_p (op1def))
@ -854,7 +854,7 @@ build_and_add_sum (tree tmpvar, tree op1, tree op2, enum tree_code opcode)
{
if (gimple_code (op2def) == GIMPLE_PHI)
{
gsi = gsi_start_bb (gimple_bb (op2def));
gsi = gsi_after_labels (gimple_bb (op2def));
gsi_insert_before (&gsi, sum, GSI_NEW_STMT);
}
else
@ -879,7 +879,7 @@ build_and_add_sum (tree tmpvar, tree op1, tree op2, enum tree_code opcode)
{
if (gimple_code (op1def) == GIMPLE_PHI)
{
gsi = gsi_start_bb (gimple_bb (op1def));
gsi = gsi_after_labels (gimple_bb (op1def));
gsi_insert_before (&gsi, sum, GSI_NEW_STMT);
}
else