This is the mail archive of the gcc-patches@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]

Re: Turn check macros into functions. (issue6188088)


On May 15, 2012, at 11:23 AM, Steven Bosscher wrote:
> On Tue, May 15, 2012 at 7:19 PM, Lawrence Crowl <crowl@google.com> wrote:
>> The gcc source uses several constructs that GDB does not understand.
>> This patch corrects some of them.  It affects only compilers built
>> with ENABLE_TREE_CHECKING, and hence release compilers are unaffected.
>> Index: gcc/ChangeLog.cxx-conversion
> (...)
>> 
>> 2012-05-15  Lawrence Crowl  <crowl@google.com>
>> 
> 
> Is this something you could do for the mainline instead?
> 
> If not, then I hope it will land there some day. I now usually build
> my debug compilers with checking disabled to work around this issue..

Gosh, we compile with -g3, and use:

macro define TREE_CHECK(T, CODE) (T) 
macro define TREE_NOT_CHECK(T, CODE) (T) 
macro define TREE_CHECK2(T, CODE1, CODE2) (T) 
macro define TREE_NOT_CHECK2(T, CODE1, CODE2) (T) 
macro define TREE_CHECK3(T, CODE1, CODE2, CODE3) (T) 
macro define TREE_NOT_CHECK3(T, CODE1, CODE2, CODE3) (T) 
macro define TREE_CHECK4(T, CODE1, CODE2, CODE3, CODE4) (T) 
macro define NON_TREE_CHECK4(T, CODE1, CODE2, CODE3, CODE4) (T) 
macro define TREE_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) (T) 
macro define TREE_NOT_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) (T) 
macro define CONTAINS_STRUCT_CHECK(T, STRUCT) (T) 
macro define TREE_CLASS_CHECK(T, CLASS) (T) 
macro define TREE_RANGE_CHECK(T, CODE1, CODE2) (T) 
macro define OMP_CLAUSE_SUBCODE_CHECK(T, CODE) (T) 
macro define OMP_CLAUSE_RANGE_CHECK(T, CODE1, CODE2) (T) 
macro define EXPR_CHECK(T) (T) 
macro define NON_TYPE_CHECK(T) (T) 
macro define TREE_VEC_ELT_CHECK(T, I) ((T)->vec.a[I]) 
macro define OMP_CLAUSE_ELT_CHECK(T, I) ((T)->omp_clause.ops[I]) 
macro define TREE_OPERAND_CHECK(T, I) ((T)->exp.operands[I]) 
macro define TREE_OPERAND_CHECK_CODE(T, CODE, I) ((T)->exp.operands[I]) 
macro define TREE_CHAIN(T) ((T)->common.chain) 
macro define TREE_TYPE(T) ((T)->common.type) 
macro define RTL_FLAG_CHECK1(N, R, C1) (R)
macro define RTL_FLAG_CHECK2(N, R, C1, C2) (R)
macro define RTL_FLAG_CHECK3(N, R, C1, C2, C3) (R)
macro define RTL_FLAG_CHECK4(N, R, C1, C2, C3, C4) (R)
macro define RTL_FLAG_CHECK5(N, R, C1, C2, C3, C4, C5) (R)
macro define RTL_FLAG_CHECK6(N, R, C1, C2, C3, C4, C5, C6) (R)
macro define RTL_FLAG_CHECK7(N, R, C1, C2, C3, C4, C5, C6, C7) (R)
macro define RTL_FLAG_CHECK8(N, R, C1, C2, C3, C4, C5, C6, C7, C8) (R)

in gdbinit.in.  This gets you 99% of the way there.  The -g3 is annoying, as the sizes are large, fast machines, nice filesystems and ssd disks or better and help lesson the cost.  This gives up checking during gdb usage, I've not found that to be a problem yet.  I think this is fine for release branches and older software.  For trunk, I do like a _better_ solution, like the first patch in this thread when it can go in.  :-)


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