Message ID | orwrjdyt4q.fsf@livre.localdomain |
---|---|
State | New |
Headers | show |
Ping? This fixes a case in which -g might change the executable code, exposed with bootstrap-debug-lean. On Apr 2, 2011, Alexandre Oliva <aoliva@redhat.com> wrote: > PR debug/48333 > * calls.c (emit_call_1): Prefer the __builtin declaration of > builtin functions. http://gcc.gnu.org/ml/gcc-patches/2011-04/msg00114.html
On Fri, Jun 3, 2011 at 4:17 AM, Alexandre Oliva <aoliva@redhat.com> wrote: > Ping? This fixes a case in which -g might change the executable code, > exposed with bootstrap-debug-lean. > > On Apr 2, 2011, Alexandre Oliva <aoliva@redhat.com> wrote: > >> PR debug/48333 >> * calls.c (emit_call_1): Prefer the __builtin declaration of >> builtin functions. > > http://gcc.gnu.org/ml/gcc-patches/2011-04/msg00114.html Ok. Thanks, Richard. > -- > Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/ > You must be the change you wish to see in the world. -- Gandhi > Be Free! -- http://FSFLA.org/ FSF Latin America board member > Free Software Evangelist Red Hat Brazil Compiler Engineer >
for gcc/ChangeLog from Alexandre Oliva <aoliva@redhat.com> PR debug/48333 * calls.c (emit_call_1): Prefer the __builtin declaration of builtin functions. Index: gcc/calls.c =================================================================== --- gcc/calls.c.orig 2011-03-31 01:40:42.960373301 -0300 +++ gcc/calls.c 2011-03-31 01:46:27.655319378 -0300 @@ -272,7 +272,20 @@ emit_call_1 (rtx funexp, tree fntree ATT funmem = gen_rtx_MEM (FUNCTION_MODE, funexp); if (fndecl && TREE_CODE (fndecl) == FUNCTION_DECL) - set_mem_expr (funmem, fndecl); + { + tree t = fndecl; + /* Although a built-in FUNCTION_DECL and its non-__builtin + counterpart compare equal and get a shared mem_attrs, they + produce different dump output in compare-debug compilations, + if an entry gets garbage collected in one compilation, then + adds a different (but equivalent) entry, while the other + doesn't run the garbage collector at the same spot and then + shares the mem_attr with the equivalent entry. */ + if (DECL_BUILT_IN_CLASS (t) == BUILT_IN_NORMAL + && built_in_decls[DECL_FUNCTION_CODE (t)]) + t = built_in_decls[DECL_FUNCTION_CODE (t)]; + set_mem_expr (funmem, t); + } else if (fntree) set_mem_expr (funmem, build_fold_indirect_ref (CALL_EXPR_FN (fntree)));