Bug 42805 - [4.5 Regression] FAIL: gcc.c-torture/execute/pr42248.c compilation at -O1 and above
Summary: [4.5 Regression] FAIL: gcc.c-torture/execute/pr42248.c compilation at -O1 and...
Status: RESOLVED DUPLICATE of bug 41250
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.5.0
: P1 normal
Target Milestone: 4.5.0
Assignee: Richard Biener
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-19 14:43 UTC by John David Anglin
Modified: 2010-03-01 13:14 UTC (History)
6 users (show)

See Also:
Host:
Target: hppa-unknown-linux-gnu, hppa2.0w-hp-hpux11.11
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-03-01 12:11:19


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John David Anglin 2010-01-19 14:43:06 UTC
Executing on host: /home/dave/gnu/gcc/objdir/gcc/xgcc -B/home/dave/gnu/gcc/objdi
r/gcc/ /home/dave/gnu/gcc/gcc/gcc/testsuite/gcc.c-torture/execute/pr42248.c  -w
 -O1   -lm   -o /home/dave/gnu/gcc/objdir/gcc/testsuite/gcc/pr42248.x1    (timeo
ut = 300)
/home/dave/gnu/gcc/gcc/gcc/testsuite/gcc.c-torture/execute/pr42248.c: In functio
n 'check':
/home/dave/gnu/gcc/gcc/gcc/testsuite/gcc.c-torture/execute/pr42248.c:9:1: intern
al compiler error: in make_decl_rtl, at varasm.c:1316

Breakpoint 2, make_decl_rtl (decl=0x4008f7e0) at ../../gcc/gcc/varasm.c:1312
1312      gcc_assert (TREE_CODE (decl) != VAR_DECL
(gdb) p debug_tree (decl)
 <var_decl 0x4008f7e0 x.2
    type <record_type 0x4008f000 Scf10 type_0 BLK
        size <integer_cst 0x400107f8 constant 256>
        unit size <integer_cst 0x400100d8 constant 32>
        align 64 symtab 0 alias set -1 canonical type 0x40077f60
        fields <field_decl 0x400190b0 a type <complex_type 0x40027060 complex double>
            DC file /home/dave/gnu/gcc/gcc/gcc/testsuite/gcc.c-torture/execute/pr42248.c line 2 col 19
            size <integer_cst 0x40010468 constant 128>
            unit size <integer_cst 0x40010480 constant 16>
            align 64 offset_align 64
            offset <integer_cst 0x40010108 constant 0>
            bit offset <integer_cst 0x40010570 constant 0> context <record_type 0x40077f60> chain <field_decl 0x40019108 b>> context <translation_unit_decl 0x40023dd0 D.1206>
        pointer_to_this <pointer_type 0x4008f240> chain <type_decl 0x40023d00 D.1191>>
    used BLK file /home/dave/gnu/gcc/gcc/gcc/testsuite/gcc.c-torture/execute/pr42248.c line 9 col 1 size <integer_cst 0x400107f8 256> unit size <integer_cst 0x400100d8 32>
    align 64 context <function_decl 0x40083600 check> chain <var_decl 0x4008f840 y.3>>

(gdb) bt
#0  make_decl_rtl (decl=0x4008f7e0) at ../../gcc/gcc/varasm.c:1312
#1  0x00892cf8 in expand_expr_real_1 (exp=0x4008f7e0, target=0x0,
    tmode=VOIDmode, modifier=EXPAND_NORMAL, alt_rtl=0x0)
    at ../../gcc/gcc/expr.c:8438
#2  0x0088a0ac in expand_expr_real (exp=0x4008f7e0, target=0x0,
    tmode=VOIDmode, modifier=EXPAND_NORMAL, alt_rtl=0x0)
    at ../../gcc/gcc/expr.c:7188
...
Comment 1 Richard Biener 2010-01-19 15:18:37 UTC
Can you check if the patch that introduced the testcase is responsible for the
failure?
Comment 2 dave 2010-01-19 15:38:07 UTC
Subject: Re:  FAIL: gcc.c-torture/execute/pr42248.c compilation at -O1 and above

> Can you check if the patch that introduced the testcase is responsible for the
> failure?

Will do.

Dave
Comment 3 dave 2010-01-19 20:51:05 UTC
Subject: Re:  FAIL: gcc.c-torture/execute/pr42248.c compilation at -O1 and above

> Can you check if the patch that introduced the testcase is responsible for the
> failure?

It's not.

Dave
Comment 4 dave 2010-01-19 21:00:44 UTC
Subject: Re:  FAIL: gcc.c-torture/execute/pr42248.c compilation at -O1 and above

> > Can you check if the patch that introduced the testcase is responsible for the
> > failure?
> 
> It's not.

Testcase doesn't fail with Debian 4.3.4-6 and Debian 4.4.2-8.

Dave
Comment 5 John David Anglin 2010-02-26 18:15:52 UTC
This bug was introduced in revision 147980:

2009-05-29  Martin Jambor  <mjambor@suse.cz>

        * tree-sra.c:  New implementation of SRA.
Comment 6 Richard Biener 2010-03-01 11:48:54 UTC
Confirmed with a cross to hppa-linux.

I believe this is again related to DECL_VALUE_EXPR.  SRA does:

@@ -122,8 +60,9 @@
 
 <bb 2>:
   x.0 = x;
+  SR.3_7 = x.a;
   y.1_6 = y_1(D);
-  D.1959_2 = x.0.a;
+  D.1959_2 = SR.3_7;
   y.2_3 = y.1_6;
   if (D.1959_2 != y.2_3)
     goto <bb 3>;

but x is replaced with x.0 (callee copy).  SRA shouldn't undo this
(thus, never create replacements involving a DECL with DECL_HAS_VALUE_EXPR_P
set).

Reduced testcase:

typedef struct {
  _Complex double a;
  _Complex double b;
} Scf10;

void
check (Scf10 x, _Complex double y)
{
  if (x.a != y) __builtin_abort ();
}
Comment 7 Richard Biener 2010-03-01 12:11:19 UTC
I have a patch.
Comment 8 Richard Biener 2010-03-01 13:14:11 UTC

*** This bug has been marked as a duplicate of 41250 ***