This is the mail archive of the gcc-cvs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

r190211 - in /branches/google/gcc-4_7/gcc: Chan...


Author: ccoutant
Date: Tue Aug  7 20:25:53 2012
New Revision: 190211

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=190211
Log:
This patch is for the google/gcc-4_7 branch.  It backports the following
patch from trunk at r190190:

  http://gcc.gnu.org/ml/gcc-patches/2012-08/msg00321.html

GCC generates non-virtual thunks directly to assembly code, which
causes a couple of problems. First, it doesn't add source location
information to the thunk, so the thunk simply inherits the random
location from the end of the function in front of it (the function
it's a thunk for). In two different compilation units compiled
with different options, this could result in two different locations
for the same thunk, and gold will give a false positive ODR
violation warning.

Second, if you try to compile with -S -dA, GCC crashes in final(),
where it's trying to build a mapping from insn to bb, because the
function has no cfg, and FOR_EACH_BB_REVERSE tries to dereference
cfun->cfg without checking for non-NULL.

Bootstrapped and ran testsuite with no regressions.

Google ref b/6891766.


2012-08-06  Cary Coutant  <ccoutant@google.com>

gcc/
	* cgraphunit.c (assemble_thunk): Add source line info.
	* final.c (final): Check for non-null cfg pointer.

gcc/testsuite/
	* g++.dg/debug/dwarf2/non-virtual-thunk.C: New test case.

Added:
    branches/google/gcc-4_7/gcc/testsuite/g++.dg/debug/dwarf2/non-virtual-thunk.C
Modified:
    branches/google/gcc-4_7/gcc/ChangeLog.google-4_7
    branches/google/gcc-4_7/gcc/cgraphunit.c
    branches/google/gcc-4_7/gcc/final.c
    branches/google/gcc-4_7/gcc/testsuite/ChangeLog.google-4_7


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]