On Tue, Jun 30, 2015 at 12:10 PM, Eric Botcazou <ebotca...@adacore.com> wrote: > Hi, > > the attached Ada testcase triggers an internal error in LTO mode: > > eric@polaris:~/build/gcc/native> gcc/gnat1 -quiet lto17.adb -flto > +===========================GNAT BUG DETECTED==============================+ > | 6.0.0 20150629 (experimental) [trunk revision 225111] (x86_64-suse-linux) > GCC error:| > | in hash_scc, at lto-streamer-out.c:1445 > > This is the assertion verifying that you walk the same SCC using DFS after > starting from another element of the SCC in hash_scc. It fails here because > this second DFS is not performed with the same THIS_REF_P parameter as the > initial one, so there is no guaranteee that this will yield the same result > because DFS_write_tree will behave differently. > > Fixed by passing the THIS_REF_P and REF_P parameters for FIRST to hash_scc. > > Tested on x86_64-suse-linux, OK for the mainline?
Ok (I suppose this also affects the GCC 5 branch?) Thanks, Richard. > > 2015-06-30 Eric Botcazou <ebotca...@adacore.com> > > * lto-streamer-out.c (class DFS): Adjust hash_scc method. > (DFS::DFS): Pass this_ref_p and ref_p to hash_scc. > (hash_scc): Add this_ref_p and ref_p parameters and pass them > to the inner DFS walk. > > > 2015-06-30 Eric Botcazou <ebotca...@adacore.com> > > * gnat.dg/lto17.ad[sb]: New test. > > > -- > Eric Botcazou