On Wed, 26 Sep 2012, Richard Guenther wrote:

> 
> This fixes PR54709, the location change broke DECL_IS_BUILTIN which
> is bogously used by streamer_handle_as_builtin_p.  I am reverting
> the previous lto-symtab.c change as it is not necessary for fixing
> the testcases.  LTO bootstrap fails with this again with
> 
> /tmp/cca0yEEE.ltrans17.ltrans.o: In function `is_ctor_or_dtor.16889':
> /space/rguenther/src/svn/trunk2/libiberty/cp-demangle.c:5506: undefined 
> reference to `alloca'
> /space/rguenther/src/svn/trunk2/libiberty/cp-demangle.c:5507: undefined 
> reference to `alloca'
> /tmp/cca0yEEE.ltrans17.ltrans.o: In function `d_demangle_callback.16926':
> /space/rguenther/src/svn/trunk2/libiberty/cp-demangle.c:5227: undefined 
> reference to `alloca'
> /space/rguenther/src/svn/trunk2/libiberty/cp-demangle.c:5228: undefined 
> reference to `alloca'
> collect2: error: ld returned 1 exit status
> 
> but we want a testcase for this instead of having it magically "fixed"
> without being analyzed.
> 
> Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.

Which revealed issues.  Thus, I'm going with the following, simpler.

LTO bootstrapped (yay) on x86_64-unknown-linux-gnu, testing in progress.

2012-09-26  Richard Guenther  <rguent...@suse.de>

        PR lto/54709
        * tree.h (DECL_IS_BUILTIN): Compare LOCATION_LOCUS.

        * gcc.dg/lto/pr54709_0.c: New testcase.
        * gcc.dg/lto/pr54709_1.c: Likewise.

Index: gcc/tree.h
===================================================================
*** gcc/tree.h  (revision 191756)
--- gcc/tree.h  (working copy)
*************** struct function;
*** 2617,2623 ****
  #define DECL_SOURCE_LINE(NODE) LOCATION_LINE (DECL_SOURCE_LOCATION (NODE))
  #define DECL_SOURCE_COLUMN(NODE) LOCATION_COLUMN (DECL_SOURCE_LOCATION (NODE))
  #define DECL_IS_BUILTIN(DECL) \
!   (DECL_SOURCE_LOCATION (DECL) <= BUILTINS_LOCATION)
  
  /*  For FIELD_DECLs, this is the RECORD_TYPE, UNION_TYPE, or
      QUAL_UNION_TYPE node that the field is a member of.  For VAR_DECL,
--- 2617,2623 ----
  #define DECL_SOURCE_LINE(NODE) LOCATION_LINE (DECL_SOURCE_LOCATION (NODE))
  #define DECL_SOURCE_COLUMN(NODE) LOCATION_COLUMN (DECL_SOURCE_LOCATION (NODE))
  #define DECL_IS_BUILTIN(DECL) \
!   (LOCATION_LOCUS (DECL_SOURCE_LOCATION (DECL)) <= BUILTINS_LOCATION)
  
  /*  For FIELD_DECLs, this is the RECORD_TYPE, UNION_TYPE, or
      QUAL_UNION_TYPE node that the field is a member of.  For VAR_DECL,
Index: gcc/testsuite/gcc.dg/lto/pr54709_0.c
===================================================================
*** gcc/testsuite/gcc.dg/lto/pr54709_0.c        (revision 0)
--- gcc/testsuite/gcc.dg/lto/pr54709_0.c        (working copy)
***************
*** 0 ****
--- 1,9 ----
+ /* { dg-lto-do link } */
+ /* { dg-require-visibility "hidden" } */
+ /* { dg-extra-ld-options { -shared } } */
+ /* { dg-lto-options { { -w -fPIC -fvisibility=hidden -flto } } } */
+ 
+ foo ()
+ {
+   memcpy (0, 1, 1);
+ }
Index: gcc/testsuite/gcc.dg/lto/pr54709_1.c
===================================================================
*** gcc/testsuite/gcc.dg/lto/pr54709_1.c        (revision 0)
--- gcc/testsuite/gcc.dg/lto/pr54709_1.c        (working copy)
***************
*** 0 ****
--- 1,5 ----
+ void * memcpy (void *, void *, long);
+ bar ()
+ {
+   memcpy (0, 1, 1);
+ }

Reply via email to