This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[vta,trunk?] don't discard source location for overriders of builtins
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 07 Oct 2008 05:40:18 -0300
- Subject: [vta,trunk?] don't discard source location for overriders of builtins
We're using the wrong test to decide whether to discard the source
location of a function decl as the initial location. We want to
discard it only for actual builtin, not for functions that override
builtins. The error in the current test was detected by
-fcompare-debug, compiling IIRC some overriders of builtins in
libgfortran.
Here's the patch I'm installing in the vta branch. Ok for the trunk?
for gcc/ChangeLog.vta
from Alexandre Oliva <aoliva@redhat.com>
* cfgexpand.c (gimple_expand_cfg): Discard the source location
only for builtins that are not overridden.
Index: gcc/cfgexpand.c
===================================================================
--- gcc/cfgexpand.c.orig 2008-09-20 05:52:59.000000000 -0300
+++ gcc/cfgexpand.c 2008-09-20 18:03:50.000000000 -0300
@@ -2986,7 +2986,7 @@ gimple_expand_cfg (void)
rtl_profile_for_bb (ENTRY_BLOCK_PTR);
insn_locators_alloc ();
- if (!DECL_BUILT_IN (current_function_decl))
+ if (!DECL_IS_BUILTIN (current_function_decl))
set_curr_insn_source_location (DECL_SOURCE_LOCATION (current_function_decl));
set_curr_insn_block (DECL_INITIAL (current_function_decl));
prologue_locator = curr_insn_locator ();
--
Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}
FSFLA Board Member ÂSÃ Libre! => http://www.fsfla.org/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}