From: jakub Date: Thu, 24 Jan 2019 20:20:47 +0000 (+0000) Subject: PR debug/89006 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7fe7a53d990e941d900d4cc314cfb08e0191a021;p=thirdparty%2Fgcc.git PR debug/89006 * config/i386/i386.c (ix86_pic_register_p): Return true for UNSPEC_SET_GOT too. * g++.dg/debug/pr89006.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@268248 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 03d1b3354999..7b797550ba7b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2019-01-24 Jakub Jelinek + PR debug/89006 + * config/i386/i386.c (ix86_pic_register_p): Return true for + UNSPEC_SET_GOT too. + PR tree-optimization/88964 * gimple-loop-interchange.cc (loop_cand::analyze_induction_var): Also punt if HONOR_SNANS (chrec). diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index e0d7c74fcecd..2b5bd682639a 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -16972,6 +16972,8 @@ ix86_pic_register_p (rtx x) if (GET_CODE (x) == VALUE && CSELIB_VAL_PTR (x)) return (pic_offset_table_rtx && rtx_equal_for_cselib_p (x, pic_offset_table_rtx)); + else if (GET_CODE (x) == UNSPEC && XINT (x, 1) == UNSPEC_SET_GOT) + return true; else if (!REG_P (x)) return false; else if (pic_offset_table_rtx) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f7423fe9b382..285c69971c7e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2019-01-24 Jakub Jelinek + PR debug/89006 + * g++.dg/debug/pr89006.C: New test. + PR middle-end/89015 * gcc.dg/gomp/pr89015.c: New test. diff --git a/gcc/testsuite/g++.dg/debug/pr89006.C b/gcc/testsuite/g++.dg/debug/pr89006.C new file mode 100644 index 000000000000..13c7d217248d --- /dev/null +++ b/gcc/testsuite/g++.dg/debug/pr89006.C @@ -0,0 +1,20 @@ +// PR debug/89006 +// { dg-do compile } +// { dg-options "-O2 -g -w" } +// { dg-additional-options "-fPIC" { target fpic } } +// { dg-bogus "non-delegitimized UNSPEC UNSPEC_SET_GOT" "" { target { i?86-*-* x86_64-*-* } } 0 } + +struct A { A (bool); }; + +static void +foo (const char *x) +{ + new A (x); +} + +void +bar () +{ + foo ("foo"); + foo ("bar"); +}