public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/39829]  New: [4.5 Regression] ICE with some code that produces VCE
@ 2009-04-20 23:50 pinskia at gcc dot gnu dot org
  2009-04-20 23:51 ` [Bug tree-optimization/39829] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-04-20 23:50 UTC (permalink / raw)
  To: gcc-bugs

A simple testcase:
void foo (void * DAG_temp117584)
{
  char  uA;
  void* pA;
  void* pB;
  void* pC;
  do {
    int DAG_temp117585;
    int DAG_temp117586;
    void ** __indir_union1 = (void**)DAG_temp117584;
    DAG_temp117585 = *__indir_union1;
    DAG_temp117586 = DAG_temp117585;
    if ( DAG_temp117586 != (int)268435456 )
      pA = (void*)&uA;
    pB = (void*)&pA;
    pC = pB;
    union __block_indir0_u {  struct {  int val; }  __indir_struct; }
       * __indir_union = (union __block_indir0_u*)pC;
    f(__indir_union->__indir_struct.val);

    DAG_temp117584 += 64;
  } while (1);
}
---- CUT ---
Compile at -O1, we get the following ICE:
gcc/gcc/testsuite/gcc.c-torture/compile/20090206-2.c:19: internal compiler
error: in expand_expr_addr_expr_1, at expr.c:6817
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

If we compile with -O2, we get:
gcc/gcc/testsuite/gcc.c-torture/compile/20090206-2.c:1: internal compiler
error: in verify_expr, at tree-cfg.c:2876
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

forwprop1 produces:
  D.1591_10 = VIEW_CONVERT_EXPR<union __block_indir0_u>(pA).__indir_struct.val;

CCP2 produces:
  D.1591_10 = VIEW_CONVERT_EXPR<union
__block_indir0_u>(&uA).__indir_struct.val;

And then somewhere we must lose that the address of uA is taken because with
-O2 PRE creates:
  uA.18_15 = uA_11(D);
  D.2674_1 = uA.18_15;
  D.2676_8 = D.2674_1;
  D.2675_7 = &D.2676_8;
  pretmp.19_13 = VIEW_CONVERT_EXPR<union
__block_indir0_u>(D.2675_7).__indir_struct.val;

Which is just incorrect.


-- 
           Summary: [4.5 Regression] ICE with some code that produces VCE
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39829


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-04-22 14:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-20 23:50 [Bug tree-optimization/39829] New: [4.5 Regression] ICE with some code that produces VCE pinskia at gcc dot gnu dot org
2009-04-20 23:51 ` [Bug tree-optimization/39829] " pinskia at gcc dot gnu dot org
2009-04-21  8:37 ` rguenth at gcc dot gnu dot org
2009-04-21 12:42 ` rguenth at gcc dot gnu dot org
2009-04-21 12:42 ` rguenth at gcc dot gnu dot org
2009-04-22 13:47 ` rguenth at gcc dot gnu dot org
2009-04-22 14:14 ` hjl at gcc dot gnu dot org

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).