public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug pch/13689] New: GGC PCH breaks aliasing
@ 2004-01-14 23:17 dje at gcc dot gnu dot org
  2004-01-14 23:19 ` [Bug pch/13689] " pinskia at gcc dot gnu dot org
                   ` (27 more replies)
  0 siblings, 28 replies; 30+ messages in thread
From: dje at gcc dot gnu dot org @ 2004-01-14 23:17 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 4019 bytes --]

Parsing invokes make_decl_rtl(), which creates alias sets.  The references to 
the alias sets are saved in PCH.  When PCH is restored, we end up with 
references to alias sets that don't exist, or worse, when we create more alias 
sets, we end up with things assigend to the same alias set that don't actually 
have the same alias set.

The following example shows new_alias_set() being invoked from make_decl_rtl() 
during parsing when generating PCH:

(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y

Starting program: /gcc/dje/build/powerpc-ibm-aix5.1.0.0-20040113/gcc/cc1plus -qu
iet -nostdinc++ -isystem /gcc/dje/install/powerpc-ibm-aix5.1.0.0-20040113/powerp
c-ibm-aix5.1.0.0/include -isystem /gcc/dje/install/powerpc-ibm-aix5.1.0.0-200401
13/powerpc-ibm-aix5.1.0.0/sys-include -Winvalid-pch -Wno-deprecated -g -O2 -I/gc
c/dje/build/powerpc-ibm-aix5.1.0.0-20040113/powerpc-ibm-aix5.1.0.0/libstdc++-v3/
include/powerpc-ibm-aix5.1.0.0 -I/gcc/dje/build/powerpc-ibm-aix5.1.0.0-20040113/
powerpc-ibm-aix5.1.0.0/libstdc++-v3/include -I/gcc/dje/src/libstdc++-v3/libsupc+
+ /gcc/dje/src/libstdc++-v3/include/stdc++.h -O2 -g -o ./O2g

Breakpoint 4, new_alias_set () at /gcc/dje/src/gcc/alias.c:599
599       if (flag_strict_aliasing)
(gdb) where
#0  new_alias_set () at /gcc/dje/src/gcc/alias.c:599
#1  0x1018ff50 in get_alias_set (t=0x30313200) at /gcc/dje/src/gcc/alias.c:580
#2  0x101bbcc8 in set_mem_attributes_minus_bitpos (ref=0x302daf50,
    t=0x30312f80, objectp=1, bitpos=0) at /gcc/dje/src/gcc/emit-rtl.c:1559
#3  0x101d1d34 in make_decl_rtl (decl=0x30312f80,
    asmspec=0x1048a17c "xxxxb", 't' <repeats 20 times>, "cccccddddddddddrrrrrrre
eeeeeeeeexe", '2' <repeats 13 times>, "11111122122222221eeeeee", '<' <repeats 13
 times>, "2<121111eeeeeee2111eeeeeeeessssseeeeex1e1", 'e' <repeats 20 times>, "x
rceeeerreeeedxdxttttttdexexxe1"...) at /gcc/dje/src/gcc/varasm.c:868
#4  0x101d305c in assemble_external (decl=0x30312f80)
    at /gcc/dje/src/gcc/varasm.c:1635
#5  0x100ba0e4 in dfs_initialize_vtbl_ptrs (binfo=0x3030e4c0, data=0x3030e4c0)
    at /gcc/dje/src/gcc/cp/init.c:722
#6  0x1030f548 in dfs_walk_real (binfo=0x3030e4c0,
    prefn=@0x2002cef4: 0x100b9ff4 <dfs_initialize_vtbl_ptrs>, postfn=0,
    qfn=@0x2002a978: 0x10313910 <unmarkedp>, data=0x30314390)
    at /gcc/dje/src/gcc/cp/search.c:1641

The following example shows the alias set value causing the failure on AIX 
appearing in memory restored by PCH:

Breakpoint 4, get_alias_set (t=0x3234e400) at /gcc/dje/src/gcc/alias.c:452
452       if (! flag_strict_aliasing || t == error_mark_node
(gdb) print t->type.alias_set
$1 = 7
(gdb) print &(t->type.alias_set)
$2 = (long long *) 0x3234e450

Breakpoint 5, gt_pch_restore (f=0xf01aec98)
    at /gcc/dje/src/gcc/ggc-common.c:555
555       for (rt = gt_ggc_deletable_rtab; *rt; rt++)
(gdb) print *(long long *) 0x3234e450
Cannot access memory at address 0x3234e450
(gdb) finish
Run till exit from #0  gt_pch_restore (f=0xf01aec98)
    at /gcc/dje/src/gcc/ggc-common.c:555
0x1039e7c4 in c_common_read_pch (pfile=0x2009b8f8,
    name=0x200c1208 "/gcc/dje/build/powerpc-ibm-aix5.1.0.0-20040113/powerpc-ibm-
aix5.1.0.0/libstdc++-v3/include/powerpc-ibm-aix5.1.0.0/bits/stdc++.h",
    fd=16384, orig_name=0x32309000 "1&#9788;â\2001r\214")
    at /gcc/dje/src/gcc/c-pch.c:388
388       gt_pch_restore (f);
(gdb) print *(long long *) 0x3234e450
$3 = 7

-- 
           Summary: GGC PCH breaks aliasing
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: critical
          Priority: P1
         Component: pch
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dje at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,geoffk at geoffk dot org
 GCC build triplet: powerpc-ibm-aix5.1.0.0
  GCC host triplet: powerpc-ibm-aix5.1.0.0
GCC target triplet: powerpc-ibm-aix5.1.0.0


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


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

end of thread, other threads:[~2004-01-27 13:06 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-14 23:17 [Bug pch/13689] New: GGC PCH breaks aliasing dje at gcc dot gnu dot org
2004-01-14 23:19 ` [Bug pch/13689] " pinskia at gcc dot gnu dot org
2004-01-14 23:20 ` dje at gcc dot gnu dot org
2004-01-15  0:18 ` steven at gcc dot gnu dot org
2004-01-15  0:20 ` bangerth at dealii dot org
2004-01-15  0:22 ` pinskia at gcc dot gnu dot org
2004-01-15  0:37 ` mark at codesourcery dot com
2004-01-15  2:07 ` geoffk at gcc dot gnu dot org
2004-01-15  2:09 ` pinskia at gcc dot gnu dot org
2004-01-15  2:14 ` geoffk at gcc dot gnu dot org
2004-01-15  2:17 ` dberlin at dberlin dot org
2004-01-15  2:18 ` dje at watson dot ibm dot com
2004-01-15 13:17 ` steven at gcc dot gnu dot org
2004-01-15 17:33 ` geoffk at gcc dot gnu dot org
2004-01-15 18:40 ` dje at watson dot ibm dot com
2004-01-15 21:36 ` geoffk at desire dot geoffk dot org
2004-01-15 22:23   ` Jan Hubicka
2004-01-15 22:23 ` hubicka at ucw dot cz
2004-01-15 22:41 ` steven at gcc dot gnu dot org
2004-01-16  3:14 ` dje at watson dot ibm dot com
2004-01-16  7:28 ` cvs-commit at gcc dot gnu dot org
2004-01-16  7:29 ` geoffk at gcc dot gnu dot org
2004-01-16 16:56 ` pinskia at gcc dot gnu dot org
2004-01-17  0:47 ` cato at df dot lth dot se
2004-01-17  9:31 ` cvs-commit at gcc dot gnu dot org
2004-01-17  9:32 ` geoffk at gcc dot gnu dot org
2004-01-18  4:23 ` dje at watson dot ibm dot com
2004-01-18 22:36 ` cato at df dot lth dot se
2004-01-23 22:10 ` dje at gcc dot gnu dot org
2004-01-27 13:10 ` cvs-commit 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).