Bug 42833 - [4.5 Regression] sra miscompiles qemu
Summary: [4.5 Regression] sra miscompiles qemu
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.5.0
: P1 normal
Target Milestone: 4.5.0
Assignee: Richard Henderson
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2010-01-21 16:55 UTC by Richard Henderson
Modified: 2010-01-22 23:54 UTC (History)
3 users (show)

See Also:
Host:
Target: x86_64-linux
Build:
Known to work: 4.4.2
Known to fail: 4.5.0
Last reconfirmed: 2010-01-21 20:29:09


Attachments
test case (512 bytes, text/plain)
2010-01-21 16:56 UTC, Richard Henderson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Henderson 2010-01-21 16:55:43 UTC
The reduced test case compiles down to 

        xor   %eax,%eax
        ret

which comes from an invalid transformation in .030t.esra

  conv_u.v = vdest;
  res_115 = conv_u.i;
->
  D.2888_153 = VIEW_CONVERT_EXPR<uint32_t>(vdest);
  vdest.v1 = vdest$v1_154;
  vdest.v2 = vdest$v2_152;
  vdest.v3 = vdest$v3_151;
  vdest.v4 = vdest$v4_150;
  conv_u$i_171 = D.2888_153;

Note in particular that the components of vdest are stored after
we've done the view_convert.
Comment 1 Richard Henderson 2010-01-21 16:56:46 UTC
Created attachment 19683 [details]
test case
Comment 2 Richard Henderson 2010-01-22 18:52:31 UTC
Subject: Bug 42833

Author: rth
Date: Fri Jan 22 18:52:01 2010
New Revision: 156176

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=156176
Log:
	PR tree-opt/42833
	* tree-sra.c (sra_modify_assign): Delay re-gimplification of
	the RHS until after generate_subtree_copies has insertted its
	code before the current statement.

Added:
    trunk/gcc/testsuite/gcc.c-torture/execute/pr42833.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-sra.c

Comment 3 Richard Biener 2010-01-22 23:54:01 UTC
Fixed.